home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / games2 / graala.lha / Graal_Tutorial.text < prev    next >
Text File  |  1996-04-23  |  105KB  |  2,844 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                             GRAAL - THE MANUAL
  8.  
  9.                                ___________
  10.                                ===========
  11.                                \         /
  12.                                 |       |
  13.                                 |       |
  14.                                 |       |
  15.                                 |       |
  16.                                  \_   _/
  17.                                    | |
  18.                                    | |
  19.                                    | |
  20.                                    | |
  21.                                    | |
  22.                                   /   \
  23.                                  =======
  24.  
  25.  
  26.  
  27.                             A Tutorial Manual
  28.                               for GRAAL 1.0
  29.  
  30.  
  31.                               by Per Thulin
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.                  GRAAL is the Swedish spelling of GRAIL
  42.                  - A suitable symbol and frequent guest
  43.                            in adventure games!
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.                     © Performance Software 1995/1996
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                  CONTENTS
  64.                                  ========
  65.  
  66.  
  67.  
  68.   1 INTRODUCTION
  69.       1.1 COPYRIGHT NOTICE(S)
  70.       1.2 ABOUT THE MANUAL
  71.       1.3 RELEASE INFO
  72.       1.4 KNOWN BUGS
  73.  
  74.   2 (FINALLY:) THE INTRODUCTION
  75.       2.1 SO, WHAT IS GRAAL?
  76.       2.2 OTHER TOOLS OF THE TRADE
  77.       2.3 THE THINGS THAT MAKE A GRAAL
  78.       2.4 GRAAL SCRIPT FILES
  79.       2.5 THE GRAAL.MAIN FILE
  80.       2.6 THE .ROOM FILES
  81.       2.7 THE .SECTION FILES
  82.       2.8 THE .SCENE FILES
  83.       2.9 THE .PTRN FILES
  84.       2.10 RUNNING THE ADVENTURE
  85.  
  86.   3 STARTING ON AN ADVENTURE
  87.       3.1 STARTING ON THE GRAAL.MAIN FILE
  88.       3.2 THE HERO - WHAT A CHARACTER!
  89.       3.3 BASICS ABOUT IMAGES AND BOBS
  90.       3.4 THE IMAGES IN THE GRAAL.MAIN FILE
  91.  
  92.   4 "A ROOM! A ROOM! A KINGDOM FOR A ROOM!"
  93.  
  94.   5 THE OBJECT MATTER
  95.  
  96.   6 SECTION OBJECTS AND BOBS
  97.  
  98.   7 (LIGHTS! CAMERA! ACTION!)
  99.  
  100.   8 USING EXITS
  101.  
  102.   9 THE DACT STATEMENTS
  103.  
  104.   10 HAVING A CHAT
  105.  
  106.   11 MASTER CLASS: CHARACTER AND GRAPHICS DESIGN
  107.       11.1 SIZE
  108.       11.2 COLOUR
  109.       11.3 DESIGNING ANIMATIONS
  110.       11.4 ALL ABOUT 3D AND HOTSPOTS
  111.  
  112.   12 MASTER CLASS: CUTSCENES
  113.       12.1 HOP, SKIP AND JUMP
  114.       12.2 NO BREAKS!
  115.       12.3 NESTING
  116.  
  117.   13 MASTER CLASS: SPECIAL TECHNIQUES OR "HOW THE HECK DID HE DO THAT?"
  118.       13.1 SPEAKING IN A FOREIGN TONGUE
  119.       13.2 AN AUTOMATED ROOM
  120.       13.3 THE ART OF AVOIDING A SEAGULL
  121.       13.4 A SPITTING IMAGE
  122.       13.5 A MAP ROOM
  123.       13.6 A SMALL GUY
  124.  
  125.   14 MASTER CLASS: HINTS AND TIPS
  126.       14.1 FLAGS
  127.  
  128.   15 QUESTIONS AND ANSWERS
  129.  
  130.  
  131.   APPENDICES
  132.  
  133.   A THE ON-LINE MONITOR
  134.       A.1 OBJECT CONTROL
  135.       A.2 ROOM CONTROL
  136.       A.3 DIALOGUE CONTROL
  137.       A.4 BACK TO GRAAL
  138.  
  139.   B "PRODUCTIFYING" YOUR ADVENTURES
  140.       B.1 THE DISKINFO.GRAAL FILE
  141.       B.2 THE DEVELOPMENT PROCESS
  142.  
  143.   C THE EDITOR
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150. 1 INTRODUCTION
  151. ==============
  152.  
  153.  
  154.  
  155. 1.1 COPYRIGHT NOTICE(S)
  156. -----------------------
  157.  
  158. GRAAL 1.0 is Shareware. If you like it and use it, register and make
  159. me happy!
  160.  
  161. All rights to the GRAAL system remains with Performance Software and
  162. is copyright © 1995/96 Per Thulin.
  163.  
  164. Users of GRAAL may use the system freely to distribute their own
  165. graphic adventures, but are completely forbidden to use any of the
  166. supplied example material - puzzles, characters, animations, or
  167. scenes - in their own work. Quite simply, all material used in your
  168. own GRAAL adventures must be your own!
  169.  
  170. The shareware version of GRAAL is not crippled in any way, but it is
  171. not quite adapted for professional use, which is explained later in
  172. this manual.
  173.  
  174. You may not use the unregistered version of GRAAL for commercial
  175. purposes. If you plan on making money out of your adventures, you
  176. MUST register GRAAL - and the registered version of GRAAL is really
  177. the only way to package GRAAL adventures in a safe and semi-professional
  178. way, not giving all the game's secrets away in unscrambled script files
  179. and the on-line monitor!
  180.  
  181.  
  182. To register, simply send the
  183. equivalent of £15 in cash to:
  184.  
  185. Per Thulin
  186. Malmtorgsgatan 18
  187. S-653 40  KARLSTAD
  188. SWEDEN
  189.  
  190. State your current shareware version. You will receive the missing
  191. production tools, and the latest version if changes have been made
  192. to the Shareware version you already have.
  193.  
  194.  
  195. GRAAL is coded in Amos Professional. You know it makes sense... :)
  196. Also, let's not forget that Black Legend Craft 1 extension. It made
  197. things that much easier!
  198.  
  199. (The GRAAL Editor is coded in Blitz 2 Basic. You know it makes even
  200. more sense... ;)
  201.  
  202.  
  203.  
  204. 1.2 ABOUT THE MANUAL
  205. --------------------
  206.  
  207. This manual contains an awful lot of text. Don't be discouraged -
  208. that is simply because each little GRAAL statement carries an awful
  209. lot of power (and because I'm such a blabbermouth), and some sophisticated
  210. initial definitions automate most of the gameplay! Before you get totally
  211. discouraged, print out the following files from the example disk(s):
  212.  
  213. graal.main
  214. 1.section
  215. 1.room
  216.  
  217. If you look at these files, and disregard the abundance of comment
  218. lines starting with /*, you will quickly realise how precious little
  219. GRAAL code is actually needed for the basics of an adventure, and be
  220. able to read on with a lighter heart!
  221.  
  222. The GRAAL documentation is divided into four main parts:
  223.  
  224. 1. This Tutorial Manual.
  225.  
  226. 2. An AmigaGuide on-line reference (graal.guide)
  227.  
  228. 3. The GRAAL Editor documentation (Editor.text)
  229.  
  230. This manual contains:
  231.  
  232. 1. This introductory section, describing what GRAAL is and what it
  233.    is not.
  234.  
  235. 2. The tutorial section, describing how GRAAL was used to create the
  236.    first seven rooms of the Olaf Longhair adventure (the demo portion of
  237.    which is supplied with this release of GRAAL).
  238.  
  239. 3. "Master Classes" - more in-depth discussions on some of the
  240.    trickier concepts - dialogues, graphics, and so on.
  241.  
  242. 4. "Q:s and A:s", a section that also will be expanded upon in the
  243.    future - provided there are enough people interested!
  244.  
  245. If you want to play the provided "Olaf" demo AND build your own
  246. Graphic Adventure, I strongly suggest you play the game first! 
  247. Because "Olaf" is used as an example throughout the tutorial, some
  248. of the secrets of the demo is given away here. This is also a good
  249. way of deciding whether this kind of stuff is what you want to spend
  250. the rest of your life doing :-)
  251.  
  252.  
  253. 1.3 RELEASE INFO
  254. ----------------
  255.  
  256. This version of GRAAL has been tested on an A600 with WB 2.05, and
  257. an A1200 with WB 3.0. (If you want to make your own games, you need
  258. at least a standard A1200 and a hard drive)
  259.  
  260. System Requirements: Hard disk, >2MB RAM and fastmem recommended.
  261. The GRAAL text editor requires WB 2.0 or above.
  262.  
  263. GRAAL v1.0 brings you:
  264.  
  265. * A graphic adventure point'n'click interface along the lines of, 
  266.   among others, the Indy games and Monkey Island (Trademarks of
  267.   LucasArts Ltd.).
  268.  
  269. * Automation of most of the main character's walking, talking, and
  270.   general fiddling around.
  271.  
  272. * 32-colour, automatically scrolling background screens, 320 to 640
  273.   pixels wide and 120 pixels high.
  274.  
  275. * "Unlimited" number of locations (rooms) in a game.
  276.  
  277. * Room and section data swapped in and out of memory at runtime to
  278.   minimise the growth of permanent in-memory data as the adventure
  279.   grows.
  280.  
  281. * Side-view "simulated 3D" scenes with foreground, any level of
  282.   middle and background objects.
  283.  
  284. * Animated objects and characters.
  285.  
  286. * Pixel-perfect detection of objects.
  287.  
  288. * A rather intelligent and easy-to-use dialogue system for those
  289.   totally silly discussions with sidekick characters we all have come
  290.   love so much.
  291.  
  292. * An equally intelligent and smart but perhaps a little more
  293.   difficult-to-grasp floor definition system - for defining legal
  294.   movement paths and automatic negotiation of obstacles.
  295.  
  296. * Cut-scenes.
  297.  
  298. * Soundtracker style music modules for background music.
  299.  
  300. * IFF and raw samples for sound effects.
  301.  
  302. * Some control over the graphics of the user interface. (More to
  303.   come in version 2.)
  304.  
  305. * Run-time error checking (such as it is...)
  306.  
  307. * Automatically detects if a GRAAL adventure is run from diskette or
  308.   hard disk, and adjusts disk swapping and save/load routines
  309.   accordingly.
  310.  
  311. * Also detects extra memory and uses this as cache memory to avoid
  312.   unnecessary disk access.
  313.  
  314. * All tools needed except an art/animation package and (optional)
  315.   sound sampler equipment.
  316.  
  317. * Diskette layout system for automatic copying and labelling of
  318.   distribution master diskettes.
  319.  
  320. * Dynamic on-line monitor and debugger for script testing, on-the-
  321.   fly temporary corrections, and examination of the game status.
  322.  
  323. * A text editor especially constructed to be GRAAL-friendly.
  324.  
  325.  
  326. The developer's registered version also gives you:
  327.  
  328. * Optimisation and encryption of distribution files.
  329.  
  330. * The run-time version of GRAAL (GRAAL_RUN) with the monitor and
  331.   break-keys disabled.
  332.  
  333.  
  334. It does NOT bring you:
  335.  
  336. - Dynamic depth-scaling of characters.
  337.  
  338. - AGA (but on the other hand, a much broader customer base for your
  339.   games. Let's be kind to those ECS users out there! :)
  340.  
  341. - Fully configurable command area and graphics set-up
  342.   ( definitely in version 2! ).
  343.  
  344. - Multiple character control
  345.   ( planned for version 334.0. Let's be honest - it hasn't added too
  346.   much to the games where it has been used ;-)
  347.  
  348.  
  349. 1.4 KNOWN BUGS
  350. ---------------
  351.  
  352. * On my A1200/WB3.0, something in GRAAL (and other large, compiled
  353.   Amos Pro programs) constantly triggers the Workbench warning sound.
  354.   This is a little annoying, and I cannot guarantee that there is a
  355.   way to fix it, since the problem lies somewhere within the way Amos
  356.   Pro compiles.
  357.  
  358.   However, the remedy is simple enough: Just make sure to turn the
  359.   Workbench warning signals off using Prefs before using GRAAL or
  360.   playing a GRAAL game.
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367. 2 (FINALLY:) THE INTRODUCTION
  368. =============================
  369.  
  370.  
  371. Welcome to GRAAL. Maybe thy quest is over!
  372.  
  373. ...or maybe it has just begun. Because, although GRAAL is a powerful
  374. tool, designing a graphic adventure still needs an awful lot of hard
  375. work from your side - all GRAAL does is take most of the actual
  376. coding work out of the job and lets you get on with designing the
  377. story, logic, backgrounds, objects, animated characters and
  378. dialogue! Which, in itself, should keep you busy for quite a while.
  379.  
  380. GRAAL was mainly invented along with the 7-room demo of the first
  381. ever GRAAL adventure "Olaf Longhair, Part I", delaying the release
  382. of both, but ensuring that GRAAL really works on a full-scale and
  383. rather advanced graphic adventure. Although maybe not quite up to
  384. LucasArts standards, it proves that GRAAL can make at least a
  385. budget-level game any day! And since this manual was written
  386. parallel to the code that went into "Olaf" and GRAAL itself, you
  387. should find everything of importance right here.
  388.  
  389.  
  390. 2.1 SO, WHAT IS GRAAL?
  391. ----------------------
  392.  
  393. All GRAAL adventures consist of:
  394.  
  395. * The GRAAL program, which is the "adventure engine". It is named
  396.   GRAAL_DEV in the development package. When you use it to run a
  397.   specific game, it is usually renamed to whatever that adventure
  398.   is called. There is also a version called GRAAL_RUN, which is
  399.   used when distributing your game to the players. It is exactly
  400.   the same as GRAAL_DEV - only in GRAAL_RUN, the ctrl-C break key, 
  401.   the amiga-M "switch to Workbench" key, and the on-line monitor
  402.   have all been disabled. Don't want them players nosing around!
  403.   (GRAAL_RUN is only available in the registered package.)
  404.  
  405. * GRAAL script files, containing the statements that make up the
  406.   adventure. There are different kinds of script files: One
  407.   graal.main file, .room files, .section files, .scene files, and
  408.   .ptrn files.
  409.  
  410. * IFF image files, depicting background scenes and object and
  411.   character "clip-art".
  412.  
  413. * A file called diskinfo.graal. This file contains, among other
  414.   things, the names of all the other files used in your adventure.
  415.   This file is used by GRAAL to locate files and handle disk
  416.   swapping in an intelligent way if your game gets so big it does
  417.   not fit onto one disk.
  418.  
  419. * Optionally, soundtracker music modules and sample banks.
  420.  
  421.  
  422. 2.2 OTHER TOOLS OF THE TRADE
  423. ----------------------------
  424.  
  425. If you don't have AmigaGuide (or Multiview - WB 3 and above), get hold
  426. of it NOW. You'll need it to read the on-line command reference.
  427.  
  428. You will not go far without a good paint program like Deluxe Paint, 
  429. Brilliance or Personal Paint to create all backgrounds, objects and
  430. animations. An image processing program like Photopaint, Image FX
  431. or ADPro is a good complement.
  432.  
  433. To take some of the work out of the backdrop scene creation, why not
  434. use a 3D modelling and rendering package? (Believe it or not, there
  435. are some good ones that are freeware, even - POV-ray, for instance.)
  436.  
  437. A sound sampler and software could also come in handy, as could a
  438. scanner or digitizer. But hey, it's up to you. Or rather, your
  439. wallet.
  440.  
  441.  
  442. 2.3 THE THINGS THAT MAKE A GRAAL
  443. --------------------------------
  444.  
  445. Because there are a lot of things in the GRAAL system to keep track
  446. of, and you need almost all of it to make the adventure work, the
  447. manual will try to explain most of the stuff in the tutorial form, 
  448. followed by in-depth discussions on a number of the trickier
  449. subjects and concepts. There is also an on-line command reference
  450. in Amigaguide format, which is a necessary complement to this manual, 
  451. and which will be vital once you get hang of things in general. Also, 
  452. the Olaf 1 demo provides you with well commented script files of all
  453. types. These demonstrate almost all major GRAAL techniques. (Beware:
  454. READ THE COPYRIGHT NOTICE!)
  455.  
  456. But first, a quick general look at the general structure of a
  457. GRAAL game:
  458.  
  459.  
  460. 2.4 GRAAL SCRIPT FILES
  461. ----------------------
  462.  
  463. The GRAAL code needed to make an adventure tick is contained in a
  464. number of script files. It is a compact language; if it wasn't for
  465. the heavy commenting, they would not take up too much space at all!
  466.  
  467. There are different types of script files, each controlling
  468. a different portion of the game. Their relationships form a tree-
  469. shaped structure, like this:
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.                       +-----------------+
  478.                       !   GRAAL.MAIN    !
  479.                       !                 !
  480.                       +--------+--------+
  481.                                !
  482.                 +--------------+--------------+
  483.                 !                             !
  484.        +--------+--------+           +--------+--------+
  485.        !    1.SECTION    !           !    2.SECTION    !
  486.        !                 !   . . .   !                 !
  487.        +--------+--------+           +--------+--------+
  488.                 !                             !
  489.           +-----+-----+                 +-----+-----+
  490.           !           !                 !           !
  491.      +----+----+ +----+----+       +----+----+ +----+----+
  492.      ! 1.ROOM  ! ! 2.ROOM  !       ! 3.ROOM  ! ! 4.ROOM  !
  493.      !         ! !         ! . . . !         ! !         !
  494.      +---------+ +---------+       +---------+ +---------+
  495.  
  496.  
  497. There may be any number of .section files beneath the graal.main
  498. file, and any number of .room files under each .section file.
  499.  
  500. In all these script files there are three basic kinds of lines:
  501.  
  502. Comment lines - All comment lines must begin with the characters
  503.  
  504. /*
  505.  
  506. which can be followed by any text, like in
  507.  
  508. /* This is a comment if ever I saw one!
  509.  
  510. Use comments a lot, because the GRAAL syntax is not particularly
  511. reader-friendly, and what was clear in your mind when you typed it in
  512. may seem like pointless rubbish a couple of weeks later - if you don't
  513. have the comments there to remind you.
  514.  
  515. Empty lines - may be used as separators for improved readability.
  516.  
  517. Statement lines - each statement line contains a statement (or
  518. keyword, if you will), followed by a colon, and one or more
  519. parameters separated by semicolons. Like this:
  520.  
  521. statement: parameter1;parameter2;...;parameterN
  522.  
  523. In many cases, the parameters contained in a keyword line are
  524. conditions or commands, containing their own parameters. Example:
  525.  
  526. ACTION: 4;IFRF 2=0;SAY I Can't do that;EXIT
  527.  
  528. In this example, ACTION is a statement that comes into play when
  529. GRAAL is checking a command input by the player. More precisely, the
  530. ACTION statement in this example will be used if a sentence using
  531. verb 4 (parameter 1) has been entered by the player. GRAAL will then
  532. execute the commands SAY and EXIT, but only if the condition
  533. IFRF 2=0 has been fulfilled first.
  534.  
  535. Note: There must be a space between the ":" and the parameters, but
  536. there must be no spaces around the semicolons separating the
  537. parameters! Also, there is no semi-colon after the last parameter in
  538. a line.
  539.  
  540. Each statement in a script file may be up to 255 characters long.
  541. The script files are case sensitive, so make sure all keywords are
  542. written in upper case.
  543.  
  544. Any line in the three types of script files mentioned above that does
  545. not conform to the rules will be spotted by GRAAL at run-time, normally
  546. causing the execution of the adventure to halt with an error message.
  547. Double-check everything, and use the syntax checker in the GRAAL Editor!
  548.  
  549.  
  550. 2.5 THE GRAAL.MAIN FILE
  551. -----------------------
  552.  
  553. "All right, but what do these different script files actually do?" I
  554. hear you scream.
  555.  
  556. Good questions! The first, and in many ways the most important, is
  557. the graal.main file. It is called that because that is what it must
  558. be called - if GRAAL doesn't find a graal.main file in the current
  559. directory, it will say so and terminate.
  560.  
  561. The graal.main file sets up everything that is common to the entire
  562. adventure, such as:
  563.  
  564. * All basic aspects of the main character's behaviour - he's
  565.   certainly going to be around in the entire adventure!
  566.  
  567. * Where the adventure starts.
  568.  
  569. * The fonts to be used for the user interface.
  570.  
  571. * All the objects that can be carried anywhere in the game.
  572.  
  573. * All the characters involved in dialogues.
  574.  
  575. * All the actions Olaf can take that are common to all, or at
  576.   least to most, locations.
  577.  
  578.  
  579. 2.6 THE .ROOM FILES
  580. -------------------
  581.  
  582. Once GRAAL has interpreted the graal.main file, it knows which room
  583. file to look for first. All room files have the suffix .room
  584. preceded by the room number, so the first room file used in the
  585. adventure is very often called 1.room . (If you decide on a better
  586. starting point for the adventure later on, you may of course tell
  587. GRAAL to start in, for example, room 45 instead.)
  588.  
  589. Since GRAAL reserves memory for each possible room number from 1 and
  590. up to the highest room number used, it is quite wasteful to have
  591. "gaps" in the room sequence. If you have deleted some rooms in the
  592. middle of the sequence, use the vacant numbers when you add new
  593. rooms, thus minimising the gaps in the numbering sequence.
  594.  
  595. The .room files do much the same for each adventure location or
  596. "room" as the graal.main file does for the adventure as a whole.
  597.  
  598. They contain, among other things, the following:
  599.  
  600. * The name of the IFF file to be used as the background in the
  601.   Scene Area.
  602.  
  603. * Information about "clip-art" to be loaded in and used as graphic
  604.   elements and objects for this particular room.
  605.  
  606. * The dialogues that take place in this room.
  607.  
  608. * The objects that can only exist within this room.
  609.  
  610. * All actions that are specific to this room.
  611.  
  612.  
  613. 2.7 THE .SECTION FILES
  614. ----------------------
  615.  
  616. .section files are very similar to .room files. Their main purpose
  617. in life is to make GRAAL more memory efficient. The basic idea is
  618. that many graphic adventures are divided into logical sections, a
  619. section being a number of connected rooms where the same objects can
  620. be handled and a number of puzzles need to be solved before you can
  621. move on to the next section. However, once you are through with a
  622. section, there are a number of objects and images you will never use
  623. again, and therefore they can be deleted from memory the freed space
  624. can be used for the objects of the new section. Or, perhaps the
  625. rooms of the section share a lot of graphics - like a labyrinth in a
  626. system of caves probably would.
  627.  
  628. How you define sections is up to you, and you do not need to use the
  629. concept at all if it is irrelevant. (In that case, just use section
  630. 1 for all the rooms, and place no commands in the 1.SECT file - just
  631. a few comment lines describing what the blazes you are up to, with a
  632. couple of totally blank lines in between.)
  633.  
  634. Well, how about it? Ready to make an adventure?
  635.  
  636.  
  637. 2.8 THE .SCENE FILES
  638. --------------------
  639.  
  640. .scene files are known as cut-scene files, containing non-
  641. interactive parts of the adventure (playing much like cartoon
  642. movies).
  643.  
  644. The cut-scene files are a little special (but simpler) than the
  645. previous script files, and will be discussed later on.
  646.  
  647.  
  648. 2.9 THE .PTRN FILES
  649. -------------------
  650.  
  651. .ptrn files are not scripts as such - they contain definitions of
  652. animation patterns that would be too long to enter into the other
  653. script files directly, or you wish to re-use in a number of
  654. different places in your scripts - or all of the above. (For those
  655. of you familiar with Amos Pro, the contents of the PTRN files follow
  656. the AMAL syntax exactly.)
  657.  
  658.  
  659. 2.10 TESTING AN ADVENTURE
  660. -------------------------
  661.  
  662. At some point or other, you feel that the script files are ripe for
  663. testing. This is imply a matter of trying to start the adventure by
  664. running GRAAL_Dev, which must be placed in the same directory as all
  665. the script and graphics files you refer to in the game.
  666.  
  667. (You should, of course, run the syntax checker in the GRAAL_Editor
  668. on all scripts first to get rid of all typing errors and other such
  669. mistakes. This takes far less time than re-running GRAAL_Dev!)
  670.  
  671. First, the GRAAL_Dev program loads and de-crunches itself. Then, the
  672. GRAAL title screen is shown. The progress indicator (the horizontal bar)
  673. indicates that the contents of the graal.main file are being loaded
  674. and processed. When the title screen disappears and the screen goes
  675. blank for a moment, the system is working on the first .room script.
  676.  
  677. Most likely, you will get some error messages before everything starts
  678. running smoothly. A GRAAL "run-time error" message will appear in yellow
  679. text surrounded by a red border on screen, stating the type of error, which
  680. room was currently loaded, and which file was last accessed. Note: This
  681. file may in some cases not be the actual culprit! For example, If GRAAL
  682. has loaded a small cutscene file, executed it and run into a problem in
  683. the calling script later on, it is still the name of the completely
  684. innocent cutscene file that is shown, so take this information for what
  685. it is.
  686.  
  687. Some problems may be of a less severe nature. In those cases, GRAAL
  688. sometimes lets you decide whether to continue playing, or exit the
  689. program (in which case it tries to clean up the memory just as if you
  690. give the "Q"uit command when playing the game the normal way).
  691.  
  692. Continuing after such a warning is not always safe: The error almost
  693. certainly affects some aspect of the game. However, things like flag
  694. value errors may often be corrected using the on-line monitor (see the
  695. appendices).
  696.  
  697. Also note that in the error messages, the offensive statements and commands
  698. are sometimes printed in a slighlty different way from how they appear
  699. in the script: All RBOBn, SBOBn, ROBJn and SOBJn statements are "translated"
  700. to show a numeric BOB image or object number. So if your N_xxxxBOBS
  701. statement in the graal.main file decide that ROOMBOBS start at image number
  702. 51, an erroneous statement containing RBOB4 would actually show up as
  703. the number "54" in the error message.
  704.  
  705. Since this is version 1.0, there's bound to be some errors that is not
  706. trapped properly, and the system may just "die on you". In those cases, 
  707. try to determine how far the loading process has actually gone, and check
  708. the structure of YOUR scripts carefully against the Olaf 1 demo and the
  709. order in which things appear there!
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716. 3 STARTING ON AN ADVENTURE
  717. ==========================
  718.  
  719.  
  720. I won't bother you with a lot of talk about how you must plan the
  721. contents of your adventure, have a good storyline, and so on and so
  722. forth. If you don't that's not my fault, is it? I simply assume you
  723. HAVE a story to tell, and that you are well aware of how graphic
  724. adventures of this kind works - if you don't, you'd better play some
  725. first. I will then show how you can do it all using GRAAL.
  726.  
  727. I won't even go into the basic idea behind my example adventure "Olaf
  728. Longhair", because surely you have played the demo by now!
  729.  
  730. This tutorial concentrates on everything that makes the first four
  731. rooms in Olaf Longhair tick - because once we have that much going, 
  732. almost everything follows along the same lines (or will be pointed
  733. out separately).
  734.  
  735. The four rooms, in order of appearance, are:
  736.  
  737. 1. The bar, where Olaf wakes up the morning after the night before, 
  738.    and has an informative chat with the bartender.
  739.  
  740. 2. The street outside the bar, where he bumps into a strange-
  741.    looking guy with an even stranger-looking animal.
  742.  
  743. 3. The harbour, where he meets a foreign captain and deals with a
  744.    rather irritating seagull.
  745.  
  746. 4. The shopping emporium of one Ali Harrod, Esq.
  747.  
  748.  
  749. 3.1 STARTING ON THE GRAAL.MAIN FILE
  750. -----------------------------------
  751.  
  752. Look at the graal.main file now.
  753.  
  754. The only sensible way to create a graal.main file is to take one
  755. that works and alter all the parameters to make it suitable for the
  756. new adventure.
  757.  
  758. Here are some statements that can set almost immediately. The other
  759. ones will be dealt with once we start designing rooms, objects and
  760. characters for the adventure.
  761.  
  762. NAME: "Olaf Longhair - GRAAL Demo Version"
  763.  
  764. The name of my adventure is "Olaf Longhair Goes East". (The quotes
  765. are not there because they enclose a string or anything - I actually
  766. want them displayed on screen when the name of the adventure is
  767. called up by pressing the [V] key during a game!)
  768.  
  769. VERSION: ...
  770.  
  771. The adventure version number. This is especially useful to guarantee
  772. that you don't try to load old saved game files when testing a newer
  773. version of the adventure.
  774.  
  775. EXIT_COL: 8
  776.  
  777. The colour index of the colour used to display the names of exits on
  778. screen when the cursor hits them. (If you do not know what a colour
  779. index is, get out the manual for your paint program NOW and
  780. familiarise yourself with the concept of screen resolutions and
  781. colour palettes!)
  782.  
  783. OBJ_COL: 1
  784.  
  785. The colour index of the colour used to display the names of objects
  786. on screen when the cursor hits them.
  787.  
  788. START_ROOM: 1;1
  789.  
  790. The starting position for the whole adventure. 1;1 means room 1, 
  791. entrance 1. Seems like a good starting point, but any existing
  792. position may be used if you suddenly decide you've found a better
  793. point to start the adventure.
  794.  
  795. MSGFONT: hires-5a;8
  796. COMFONT: garnet;9
  797. TITLEFONT1: emerald;20
  798. TITLEFONT2: times;14
  799.  
  800. Font names and font sizes used for various purposes. If you decide
  801. to use your own choice of fonts, these must be stored in a FONTS:
  802. drawer placed in the directory where all the GRAAL files reside.
  803. Then, this drawer must be initialised with the FIXFONTS utility.
  804. This probably the most technical thing you have to do during the
  805. creation of an adventure - refer to your Workbench manual. If you
  806. stick with the supplied fonts, you don't have to bother with this -
  807. the FONTS: drawer on disk one is already prepared and ready for use.
  808.  
  809. Note: In version 1 of GRAAL, it is unwise to alter the fonts MSGFONT
  810. and COMFONT! If you feel you have to, for some reason, the font
  811. sizes and line spacing should be exactly like the ones in the fonts
  812. used by Olaf 1.
  813.  
  814. LINE_LENGTH: 34
  815.  
  816. When characters "talk", GRAAL can insert line breaks automatically.
  817. In this case, it aims for a line length of 34 characters.
  818.  
  819. At this point, we will not get much further without bringing the big
  820. star, our main character, the man, Olaf Longhair himself, into play!
  821.  
  822.  
  823. 3.2 THE HERO - WHAT A CHARACTER!
  824. --------------------------------
  825.  
  826. One of the things GRAAL makes so easy to manage is the point and
  827. click control of the main character - in this case, Olaf.
  828. GRAAL controls what animation sequence is the correct one to use in all
  829. standard situations, in which direction Olaf is heading, where in a
  830. room he can actually place his feet, and so on.
  831.  
  832. Wonderful as all this may be, it doesn't relieve you of the responsibility
  833. for the character design - in other words, before GRAAL can do all this
  834. wonderful stuff, you must design the main character and the animations
  835. used for his basic movements.
  836.  
  837. Basically, what we need now are some still images and animation cels
  838. showing Olaf in various standardised poses. For "Olaf", all these are
  839. placed in the IFF picture file "Olaf_Original.iff", which you should
  840. take a look at now.
  841.  
  842. What the images portray are:
  843.  
  844. * Olaf walking towards, away, and sideways
  845.  
  846. * Olaf's front, back, and profile when standing still
  847.  
  848. * Olaf talking - the front, back, and profile views.
  849.  
  850. * Olaf manipulating things - also front, back and sideways views, 
  851.   but for each view also in three "height" versions - for objects
  852.   high up, far down, or "in mid-air".
  853.  
  854. As you notice, the images of Olaf in the file are neatly and evenly
  855. spaced. This makes it easier for GRAAL to "cut out" these images and
  856. store them in its image bank later.
  857.  
  858. Also note that there are no separate images for the right and left
  859. profiles - to make life a little easier, and less memory consuming, 
  860. the profile images will simply be flipped by GRAAL when a reversed
  861. view is required.
  862.  
  863. We will need more images of Olaf during the course of the game, but
  864. since they will only be used for special occasions, they are loaded
  865. into memory only when they are needed and erased afterwards. So
  866. "Olaf_Original.iff" contains all the "global" images of our main
  867. character and favourite hero.
  868.  
  869.  
  870. 3.3 BASICS ABOUT IMAGES AND BOBS
  871. --------------------------------
  872.  
  873. We are going to talk a lot about stills, cels, animations and BOBs
  874. in this tutorial, all concepts dealing with how an image is used.
  875.  
  876. A still is any image that is static.
  877.  
  878. An animation is any image that moves, and it does so by using a
  879. number of slightly different stills replacing each other, called
  880. ANIMATION CELS.
  881.  
  882. BOB is short for Blitter OBject. BOBs are well-known to Amos
  883. programmers. They are, basically, the way GRAAL displays all
  884. graphics on screen that aren't just backdrops: Objects, animated
  885. characters, texts, and so on. BOBs can be put into the display and
  886. deleted again without harming the backdrop picture. To achieve this, 
  887. the system must keep track of all the little graphic bits and pieces
  888. by assigning each one used at any time with a BOB number. To make it
  889. easier to keep track of the images used by the BOBs, they are stored
  890. in a BOB image bank.
  891.  
  892. Any BOB may use any image (or vice versa, depending on how you look
  893. at the world). For example, BOB number 44 may be used to display a
  894. flower, held in image bank position 56, in one scene. In another
  895. room or scene, the same BOB number 44 may be used to display a
  896. knife, which is image 78 in the bank. Confusing? Just keep this in
  897. the back of your head until we start discussing the script file
  898. statements!
  899.  
  900. Since re-cycling is the word of the day, there is no difference in
  901. the image types used for different purposes - all are stored in the
  902. BOB image bank, and you may use the same image as an animation cel
  903. in one situation and as a still image in another.
  904.  
  905. The BOB bank where we store all images, must be logically divided
  906. into four sections:
  907.  
  908. 1. BOB images for system use ALWAYS occupy slots 1-10. Do not
  909.    change these in GRAAL v1. These hold things like cursor shapes, 
  910.    the movie camera icon for cut-scenes, etc.
  911.  
  912. 2. Global BOB images are those that are kept in memory at all
  913.    times, for example all Olaf's basic movements. The number of
  914.    slots used for these are defined with the N_GLOBALBOBS: statement.
  915.    11 is always the starting number for this range. Make an
  916.    educated guess how many of these you'll need. "Olaf" uses about
  917.    40, which translates to images 11 to 50.
  918.  
  919. 3. Room BOB images are images that are only needed in a specific
  920.    room - as soon as the game switched to a new room, all these
  921.    images are erased from memory and replaced by the graphics for
  922.    the new room. The number of these is defined by the N_ROOMBOBS:
  923.    statement.
  924.  
  925. 4. Section BOB images work the same way as room BOBs, but for a
  926.    section (collection of connected rooms) rather than a single
  927.    room. Their number is defined by the N_SECTIONBOBS: statement.
  928.  
  929. If you make a mistake when estimating the number of each image
  930. category here, it is not the end of the world. The definitions can
  931. be altered at any time later on.
  932.  
  933.  
  934. 3.4 THE IMAGES IN THE GRAAL.MAIN FILE
  935. -------------------------------------
  936.  
  937. Back to the graal.main file now, to practice what was just preached:
  938.  
  939. N_GLOBALBOBS: 40
  940. N_SECTIONBOBS: 30
  941. N_ROOMBOBS: 70
  942.  
  943. This means that right now, we believe we need 40 global BOB images, 
  944. 30 for use in sections, and 70 for use in rooms. If we change our
  945. minds later on, we can always change the numbers then.
  946.  
  947. Let's define the main character's images. The statement
  948.  
  949. CLPART: Olaf_Original.iff
  950.  
  951. tells GRAAL that following statements will grab images from the
  952. picture file Olaf_Original.iff
  953.  
  954. BOBS: 10;11;1;1;31;47;32;0
  955.  
  956. tells GRAAL to grab 10 BOB images and store them in image slot 11
  957. and upwards (slots 1-10 are reserved for system use, remember?)
  958.  
  959. More BOBS and CLPART statements follow upon this first one, until
  960. all basic images we need have been stored in the image bank.
  961.  
  962. Now the images we need for Olaf's basic behaviour is in the image
  963. bank, which means we can tell GRAAL a little about their basic
  964. properties and how they should be used.
  965.  
  966. CHARACTER_HEIGHT: 40
  967. CHARACTER_WIDTH: 22
  968.  
  969. are two statement stating Olaf's approximate and average height and
  970. width. These values are used to position Olaf properly on the
  971. background in relation to walls, and also to place the text
  972. representing Olaf's speech at a proper distance above his head.
  973.  
  974. CHARACTER_COL: 9
  975.  
  976. Olaf's speech will be shown as text with colour no. 9. Use a rather
  977. bright colour, which along with the automatically added black border
  978. around the text should make it readable enough.
  979.  
  980. STILL_RIGHT: 14
  981. STILL_LEFT: $800E
  982. STILL_BACK: 12
  983. STILL_FRONT: 11
  984.  
  985. These statements tell which still images are to be shown when Olaf
  986. is facing in the respective direction, doing nothing.
  987.  
  988. But wait a minute: What is that strange BOB image $800E? Oh, that's
  989. quite simple, at least according to the very special logic of AMOS
  990. Pro syntax: It is simply image 14, flipped over so that it faces
  991. left instead of right! The "$" indicates that this is a hexadecimal
  992. number. Well, "E" is 14 in hexadecimal, and the Amos Pro way of
  993. flipping BOBs is to add hex 8000 to the image number! Thus, 14, 
  994. flipped over, is $800E!
  995.  
  996. (This strange remnant of Amos syntax may be eliminated in coming
  997. versions of GRAAL - then again, it may not. It would slow execution
  998. down if I altered it.)
  999.  
  1000. Anyway, on with it.
  1001.  
  1002. PAUSE_RIGHT: 13
  1003. PAUSE_LEFT: $800D
  1004. PAUSE_BACK: 12
  1005. PAUSE_FRONT: 11
  1006.  
  1007. These images are used when Olaf pauses after having gone in a
  1008. certain direction. If you wish, they may be set to exactly the same
  1009. values as the STILL_ images. However, as you see, Olaf uses image
  1010. 13, a slightly more relaxed, forward-facing and "ready-for-input"
  1011. pose, for the right and left poses in these statements than in the
  1012. STILL_ statements. 
  1013.  
  1014. (You don't HAVE to make the left pose the flipped-over version of
  1015. the right pose - if you want to draw different images for each
  1016. direction, go right ahead. But I'm too lazy!)
  1017.  
  1018. WALK_RIGHT: A 0,(16,6)(15,6)(14,6)(17,6)(18,6)(17,6) ...
  1019. WALK_LEFT: A 0,($8010,6)($800F,6)($800E,6)($8011,6) ...
  1020. WALK_AWAY: A 0,(29,8)(30,8)(31,8)(30,8)
  1021. WALK_TOWARD: A 0,(26,8)(27,8)(28,8)(27,8)
  1022.  
  1023. So far, all we have done is to specify still images. Now we enter
  1024. into the gruelsome, yet strangely attractive world of animation! And
  1025. yes, AMOS Pro users will immediately give a cry of joy: It's AMAL!
  1026.  
  1027. AMAL is AMOS Pro's animation language, and yes, GRAAL uses the same
  1028. syntax for animations. So let's see what we've got here:
  1029.  
  1030. "A 0," simply tells GRAAL to repeat the following animation sequence
  1031. indefinitely. (Stay calm - GRAAL will handle all starting and
  1032. stopping of standard character animations automatically.)
  1033.  
  1034. "(16,6)(15,6)(14,6)" and so on are the images and display lengths of
  1035. each animation cel. For WALK_RIGHT, first image 16 is displayed for
  1036. 6 frames (=screen updates), then image 15 is displayed for 6 frames, 
  1037. and so on. When the end of the list is reached, the animation loops
  1038. and starts over with image 16 again. As you see in the WALK_LEFT
  1039. statements, flipped images are used in animations also - no
  1040. problems.
  1041.  
  1042. It's quite wise to use 6 frames as the smallest time space for any
  1043. image during background scrolling - 3 is possible and may work well
  1044. if you have a limited number of BOBs in each scene in your adventure.
  1045. However, if you paint on a large canvas so to speak, the system will
  1046. have problems fitting all graphic updates into a 3 frame space and so
  1047. the animation may become jerky. (6 isn't safe in all situations, but
  1048. it usually works and is a good compromise.)
  1049.  
  1050. WALK_SPEED: 1.2
  1051.  
  1052. This statement just adjusts the speed with which the character
  1053. walks. Especially when walking sideways, you wish it to look like it
  1054. is the character's feet that actually propel him across the floor -
  1055. watch some really bad cartoons, and you will spot how the characters
  1056. "glide" across the floor as if it was made of ice! The proper value
  1057. here depends on how large steps your character takes in your
  1058. animations. Do a little experimenting!
  1059.  
  1060. TALK_MAP: 11;A 0,(20,18)(11,12)(20,12)(11,6)(19,12)
  1061.  
  1062. Not only walking is animated and automated in GRAAL - talking is as
  1063. well. The animation to be used for speech in each situation is not
  1064. connected to a certain direction, but rather to what image is
  1065. displayed on screen at the time the character starts talking - The
  1066. above statement tells us to use this animation if the character is
  1067. facing forwards (image 11) when the speech starts. As you see in
  1068. graal.main, there are six TALK_MAP:s specified - all STILL_ and
  1069. PAUSE_ images are accounted for, which indeed they must be for GRAAL
  1070. automation of the speech to work in all standard situations. Up to
  1071. eight TALK_MAP:s may be specified in all.
  1072.  
  1073. HANDLE_MAP: 11;A 1,(11,12)(36,1);A 1,(11,12)(34,1); 
  1074.   A 1,(11,12)(35,1)
  1075.  
  1076. Standard "manipulation" or handling of objects are specified in a
  1077. similar manner - the animation to be used when a certain object is
  1078. handled depends on a) the previous character image on screen and b)
  1079. whether the object in question is placed high up, low down or in
  1080. mid-air - an animation sequence for each possible position is
  1081. supplied in the same statement, separated by semicolons.
  1082.  
  1083. Note that the last image in each sequence should be specified as
  1084. shown for only ONE frame - this is because a) the character will
  1085. stay in that position during the handling of the object anyway, and
  1086. b) we wish to immediately do some other graphic tricks after the
  1087. HANDLE command has been given, such as placing an object in the
  1088. character's out-stretched hand. Specifying too long a pause in these
  1089. animation sequences would produce an unwanted pause in the flow of
  1090. the script.
  1091.  
  1092. To summarise, if the character is facing forward using image 11, and
  1093. suddenly is commanded to handle an object placed in mid-air, (the
  1094. cup in the "Constantinoplian" bar is a concrete example), the middle
  1095. animation sequence in the above statement, which is "A
  1096. 1,(11,12)(34,1)", would be executed.
  1097.  
  1098. OK. That was a lot of hard work and tricky definitions to sink one's
  1099. teeth into, but guess what? We're done! We have actually completed a
  1100. large percentage of the animations needed for our hero, and can get
  1101. on with designing the adventure proper!
  1102.  
  1103. The statements we have defined above will be used and executed time
  1104. and time again throughout the adventure, and in a fully automated
  1105. fashion, too. But you control-freaks should not worry too much:
  1106. GRAAL contains enough script commands to enable you to break away
  1107. from the standard poses and animations in any given special
  1108. situation - if you are willing to take on the extra work and extra
  1109. coding in the scripts that is required.
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116. 4 "A ROOM! A ROOM! A KINGDOM FOR A ROOM!"
  1117. =========================================
  1118.  
  1119.  
  1120. As you may gather from the heading of this chapter, we now quite
  1121. badly need a room or other location to move about in - having our
  1122. hero confined to a lot of abstract image and animation statements in
  1123. the graal.main file will not make anyone happy.
  1124.  
  1125. Let's start with room number one. That's logical, because we have
  1126. already stated in the graal.main file that the adventure will start
  1127. there, remember? And this adventure starts in the bar, so room 1
  1128. will be "The Last Bar in Constantinople".
  1129.  
  1130. Similar to how the main properties of the adventure is defined in
  1131. graal.main, the properties of room 1 is defined in the file 1.room.
  1132. Have a look.
  1133.  
  1134. The first statement we come across here is
  1135.  
  1136. UPDATE: 3
  1137.  
  1138. which sets the updating speed of the scene area. The higher the
  1139. number, the slower the screen updating, and the more graphics GRAAL
  1140. is capable to shift between updates. To keep animations etc. from
  1141. becoming jerky, the number must be set high enough to cope with all
  1142. graphics.
  1143.  
  1144. Actually, this only becomes a real problem when the background is
  1145. scrolling, so the number set here is only used during such scrolls.
  1146. At all other times, the update rate is 3. And in this room, the
  1147. whole thing is completely irrelevant, because the scene fits into
  1148. the display without scrolling - it is exactly 320 pixels wide. For
  1149. other rooms, like the harbour, UPDATE: is set to 6. (I have designed
  1150. all of "Olaf":s animations to work with the update range set in
  1151. multiples of 3.)
  1152.  
  1153. Next, there comes a
  1154.  
  1155. SECTION: 1
  1156.  
  1157. statement, indicating that this room is part of section 1, as are
  1158. all the rooms making up Constantinople in this game.
  1159.  
  1160. Next, we need a background picture for the scene area. I prepared
  1161. the interior of this rather primitive bar in the file "1BG.IFF"
  1162. using the 3D modelling and rendering freeware program POV-RAY. The
  1163. gorgeous 24-bit image that was the result was then reduced to 16
  1164. colours, creating an image that is crude but suitably "cartoon-like"
  1165. for the purpose.
  1166.  
  1167. The background's 16 colour registers went into colour numbers 16-31
  1168. in the 32-colour palette, and the 16 standard colours used for Olaf
  1169. and any other common BOBs and images were copied into the palette in
  1170. places 0-15 (see the Master Classes for more info on handling
  1171. colours). The background file is defined with the
  1172.  
  1173. BG_IFF: 1BG.IFF
  1174.  
  1175. statement.
  1176.  
  1177. In GRAAL version 1, the height of the background iff:s must be 120, 
  1178. but the width may be from 320 up to 640, making for excellent
  1179. scrolling background scenarios (as shown in the Constantinople
  1180. main street and the Baghdad panorama, for instance)..
  1181.  
  1182. Each time we enter a new room, Olaf must have a starting position
  1183. and pose. This is defined by the
  1184.  
  1185. START_POS: 1;13;20;115;L;1
  1186.  
  1187. statement. This not only indicates where Olaf starts, but whether
  1188. the background screen starts scrolled to the far left, far right or
  1189. the middle. (In this case, it's all the same, since the scene fits
  1190. within the screen width.)
  1191.  
  1192. Any number of starting positions may be defined for the same room -
  1193. great for those really awkward labyrinths!
  1194.  
  1195. GRAAL is not truly 3D - nothing shown on a computer screen ever is -
  1196. but uses a simulated 3D persective. The bar in 1BG.IFF has a floor, 
  1197. extending from the very bottom of the scene area and a few lines up
  1198. in the picture - if Olaf moves higher up in the picture, he is also
  1199. going further back in the room. (The effect is demonstrated more
  1200. fully by the alley in the street outside the bar, which Olaf can
  1201. actually "walk into".)
  1202.  
  1203. Now, in order for Olaf to stay on the floor and not start climbing
  1204. the walls of the bar, we need some way of restricting his
  1205. movement. We do that using statements like
  1206.  
  1207. FLOOR: 1;16;113;304;119;1-1/2-2/3-3/4-4
  1208.  
  1209. Each such statement defines a rectangular part of the picture where
  1210. Olaf may place his feet. If there is more than one such rectangle, 
  1211. each is defined by a separate floor statement, and all floors must
  1212. overlap with at least one other floor to enable Olaf to find his way
  1213. from one floor to another. The last parameters, "1-1;2-2", describe
  1214. how Olaf navigates between the two floors in this room. See the the
  1215. FLOOR statement in the on-line reference for more information about
  1216. this.
  1217.  
  1218. It wouldn't be much fun to have a adventure take place in only one
  1219. room (although such a thing IS possible - how about a "closed room
  1220. murder mystery"?). So the next statement, 
  1221.  
  1222. EXIT: 1;5;60;12;119;10;116;Exit to\street
  1223.  
  1224. defines an exit from the bar. This creates a "clickable" rectangle
  1225. on the screen with some additional parameters describing the
  1226. properties of the exit. We will come back to the subject of
  1227. switching rooms further on.
  1228.  
  1229. So, now we have a background, an exit, and area to move about on, 
  1230. and much more. Time to add some special graphics to the room to
  1231. spice things up a little.
  1232.  
  1233. CLPART: 1FG.IFF
  1234.  
  1235. is a statement telling GRAAL that we wish to grab some clipart from
  1236. the 1FG.IFF file to use as images in this room. The
  1237.  
  1238. ROOMBOBS: ...
  1239.  
  1240. statements that comes next follow the syntax of the BOBS: statement
  1241. we used in the graal.main file. Every image grabbed with this
  1242. statement should later be referred to by a "room BOB image number", 
  1243. which is a number proceeded by "RBOB". For example, RBOB3 means room
  1244. BOB image 3.
  1245.  
  1246. The images we grab as RBOBs are all used for objects and graphics
  1247. that are unique to this room, and are not much use outside it
  1248. (although you CAN grab clipart from the same 1FG.IFF file anywhere
  1249. you like in the game, of course).
  1250.  
  1251. Perhaps some of the clipart we just loaded is supposed to be pasted
  1252. into the scene without doing anything except being pretty. The
  1253. statements STATIC: and ANIM: are used for this purpose - which one
  1254. depends on whether the image should be static or animated. We have
  1255. one static such object in the bar - the barrel behind which Olaf
  1256. appears. It has no other function except hiding Olaf at the start of
  1257. the game and being a general foreground object which adds a bit of
  1258. depth to the scene!
  1259.  
  1260. That is the graphics department of room 1 over and done with.
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268. 5 THE OBJECT MATTER
  1269. ===================
  1270.  
  1271.  
  1272. You could, theoretically, spring Olaf loose in the bar now, but
  1273. there would be absolutely nothing to do - just an exit pointing to
  1274. an undefined room, floors to move about on - and a barrel to hide
  1275. behind! So far, there is not a single object to interact with!
  1276.  
  1277. Just as with BOB images, objects are defined in various places
  1278. depending on where in the adventure they may appear - just in one
  1279. room, in a section, or in the entire adventure. Sticking with the
  1280. 1.room file for the moment, you see some
  1281.  
  1282. ROOMOBJ: ...
  1283.  
  1284. statements here. They define objects which are never removed from
  1285. the bar, and never changed in any way: One of the barrels, the plate
  1286. of spam that Olaf refuses to touch, and so on. Room objects are a
  1287. great way of adding atmosphere, detail, and red herrings to a game
  1288. without wasting computer memory - from the players' point of view, 
  1289. there is no way of telling whether an object is a room, section, or
  1290. global object. Only you know!
  1291.  
  1292. The policy in the tutorial is to leave details to the on-line
  1293. reference, but understanding the properties of an object is rather
  1294. vital, so we will examine one of the global objects present in the
  1295. bar closely. (The room objects are no good for this purpose, since
  1296. their use is severely restricted - they can't be picked, up, 
  1297. altered, or anything like that!).
  1298.  
  1299. In the graal.main file, locate the line
  1300.  
  1301. OBJECT: 1;sheep bones;1;-1;59;RBOB17;67;219;6;-106;11;with; 
  1302.   -1;0;3;124;MID;D
  1303.  
  1304. This statement describe the sheep bones on the left barrel in the
  1305. bar, and in some detail! Let's take it parameter by parameter:
  1306.  
  1307. 1; 
  1308.  
  1309. means this is global object number 1.
  1310.  
  1311. sheep bones; 
  1312.  
  1313. is the name of the object.
  1314.  
  1315. 1; 
  1316.  
  1317. is the room number where the object is initially placed.
  1318.  
  1319. -1; 
  1320.  
  1321. means the object can be seen and handled. (For most "true or false"-
  1322. type parameters, the number "-1" is used to indicate "True", whereas
  1323. "0" in the same place would mean "False".)
  1324.  
  1325. 59; 
  1326.  
  1327. is the BOB number (not the IMAGE number!) that will be used when
  1328. displaying the object.
  1329.  
  1330. RBOB17; 
  1331.  
  1332. is the BOB image number which is used to display the object by
  1333. default. This could also be an animation sequence using the same
  1334. animation syntax as the TALK_MAP: etc. statements explained
  1335. previously.
  1336.  
  1337. But wait a minute! We use an RBOB image, obviously grabbed in the
  1338. 1.room file, to display a global object, which is obviously not tied
  1339. to that one room? Isn't this strange? 
  1340.  
  1341. No, it actually makes sense. Room 1 is the only place where the
  1342. sheep bones will actually be SHOWN in that shape - when they are
  1343. used further on in the game, they will only be displayed using
  1344. special animation sequences. So this is a safe use of RBOBs!
  1345.  
  1346. 67;219; 
  1347.  
  1348. is the x and y position of the RBOBs hotspot. The y value may seem a
  1349. little high, but that is because the hotspot of this particular
  1350. object is set in a strange way to achieve its right 3D position in
  1351. the room, on top of the barrel and in front of Olaf. Se the "3D
  1352. Considerations" in the "Master Classes" for an explanation!
  1353.  
  1354. 6;-104; 
  1355.  
  1356. is the "character offset". When Olaf wants to handle the sheep
  1357. bones, he will walk to a position 6 pixels to the right and 106
  1358. pixels above the sheep bones hotspot. Once again, the y value is
  1359. strange, but that's just to compensate for the object's y hotspot
  1360. value being equally strange in the other direction in the first
  1361. place!
  1362.  
  1363. 11; 
  1364.  
  1365. is the still image used to display Olaf once he has walked up to the
  1366. object. Since the object is in front of him, he will face us using
  1367. image 11. And specifying the correct still image for each object is
  1368. vital: Should Olaf begin to handle the object after walking up to
  1369. it, the HANDLE_MAP sequence linked to image 11 will be used. Should
  1370. he start to talk, the TALK_MAP sequence linked to image 11 will be
  1371. used. But you need not worry about this, as long as you specify the
  1372. HANDLE_MAPs, TALK_MAPs and still images used for object handling
  1373. correctly!
  1374.  
  1375. with; 
  1376.  
  1377. is a preposition. If a preposition exists, it is assumed that this
  1378. object can not be USEd on its own - it must be combined with
  1379. something else, and so the sentence line will read
  1380. USE SHEEP BONES WITH, and the system will wait for a second object
  1381. to be clicked. If this parameter is left blank, the object will be
  1382. used on its own.
  1383.  
  1384. -1; 
  1385.  
  1386. indicates that the object can be picked up. (Again, "-1"=True, 
  1387. "0"=False.) This must ALWAYS be 0 for room objects, unless you make
  1388. sure you make the character drop the object again before he leaves
  1389. the room!
  1390.  
  1391. 0; 
  1392.  
  1393. If the object is animated using an animation command (instead of the
  1394. single RBOB17 for this example), the animation channel must be
  1395. specified here. The range of possible values is 2-16, and as with
  1396. BOB numbers, the same number may not be used for two things
  1397. simultaneously. The sheep bones are not animated, and therefore this
  1398. parameter is 0.
  1399.  
  1400. 3;124; 
  1401.  
  1402. These are the x and y hotspot values for the object. NOTE: In the
  1403. object statements, these numbers are not used for anything! The
  1404. hotspot positions are not actually linked to the object but to each
  1405. single BOB image. The only reason to set them here (instead of
  1406. simply stating "0;0;", which works just fine) is for informational
  1407. purposes, helping to set the x and y position correctly.
  1408.  
  1409. MID; 
  1410.  
  1411. This is an important one for all objects which can be picked or
  1412. handled! It determines which of the "handle animations" Olaf will
  1413. use. Since the sheep bones are on the barrel, in chest height, the
  1414. MID animation will be used. (Always place objects, or Olaf, using
  1415. the character offset co-ordinates so that one of the three positions
  1416. can be used in a natural way!)
  1417.  
  1418. DG; 
  1419.  
  1420. This is an "attribute string" which can be used to determine some
  1421. general properties for the object. "D" stands for dead object, and
  1422. "G" for "a group of...". These are the sheep bones' only attributes.
  1423. Attributes are used to make basic responses to some actions seem more
  1424. natural - you don't have to define separate replies to all objects, 
  1425. but can specify a general response for all cases of Olaf trying to
  1426. use the small knife on objects made of wood, for instance. You may
  1427. also find an "abstract" class very useful - when Olaf attempts to
  1428. pick up the horizon, it enables you to respond with some really
  1429. insulting remarks!
  1430.  
  1431.  
  1432. You should remember that GRAAl is quite flexible in many ways, one
  1433. being that there exists GRAAL commands to alter many of the object's
  1434. properties, such as the name, visibility, location and so forth at
  1435. any time during the game. See the on-line reference for a complete
  1436. list of commands. Generally speaking, the statements in the script
  1437. files set things up - it is the commands contained in DACT, LACT and
  1438. ACTION statements executed during gameplay that brings the whole
  1439. thing to life!
  1440.  
  1441. While we are at it, let us examine another, but more human, global
  1442. object: The bearded man / bartender.
  1443.  
  1444. Characters which are involved in dialogues must always be specified
  1445. as global objects. The bartender, starting out as the "bearded man", 
  1446. is one example. So, what is the difference between a bearded man and
  1447. some sheep bones? Well, the bartender is animated using a default
  1448. animation sequence, as you see. This sequence also uses RBOBs, since
  1449. the bartender never leaves 1.room. Furthermore, the bartender can
  1450. not be picked up (there's a relief!) and uses animation channel
  1451. number 8 for the animation. His special attributes are "MV" -
  1452. meaning he's a male character and alive.
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459. 6 SECTION OBJECTS AND BOBS
  1460. ==========================
  1461.  
  1462.  
  1463. There are a third class of objects involved in the bar scene, those
  1464. defined in the section file 1.section with the SECTIONOBJ:
  1465. statements. These are objects that only exist the very first time a
  1466. new section of the game is visited, and disappears again before the
  1467. section is exited. It is not that useful, but some of the objects in
  1468. Constantinople is of this kind - the magic flute, for example, which
  1469. disappears into the pawn shop before you can leave town.
  1470.  
  1471. You will probably find section BOB images (SBOBs) more useful than
  1472. section objects. These are grabbed in the section file the same way
  1473. RBOBs are grabbed in the room files, but with the SECTIONBOBS:
  1474. statement. Needless to say, they remain in memory during the visit
  1475. to the section, but disappear and are replaced by other graphics the
  1476. moment you walk into another game section.
  1477.  
  1478. You are not obliged to use the section concept at all, especially if
  1479. your adventure is quite small. However, you must have at least one
  1480. section file in your adventure, even if it just contains a comment
  1481. saying "Not Used". Then specify all your rooms as belonging to this
  1482. "empty" section.
  1483.  
  1484. Okay, we have everything in place, except one VERY important thing -
  1485. the instructions telling Olaf to deal with the commands you give
  1486. him!
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493. 7 (LIGHTS! CAMERA! ACTION!)
  1494. ===========================
  1495.  
  1496.  
  1497. We now have the lights and the camera, so to speak. But precious
  1498. little action. (Well, the lights aren't actually turned on yet. That
  1499. is done with a LIGHTS ON command, explained further on!)
  1500.  
  1501. All conditions and commands used to respond to the player's actions
  1502. are placed in ACTION: statements (leaving the dialogues out of it
  1503. for the moment).
  1504.  
  1505. ACTION: statements may appear in all three major types of script
  1506. file: .room, .section and graal.main.
  1507.  
  1508. The idea is that the ACTION: statements taking care of a certain
  1509. action is placed closest to the place where the action takes place.
  1510. If an action can only take place in one specific room, the ACTION:
  1511. statements for it are placed in that .room file. If the action is
  1512. only valid in a certain section, they are placed in the .section
  1513. file. If it is something that needs to be taken care of regardless
  1514. of where it appears, the graal.main file is the place.
  1515.  
  1516. In fact, almost every action should have some "safety net" in the
  1517. graal.main file - if no specific action is taken in the ACTION
  1518. statements of the .room and .section files, the graal.main ACTION:
  1519. statements should at least make it look like Olaf understood what
  1520. you were trying to do! There is nothing more unrewarding than
  1521. clicking away on lots of things and have absolutely nothing happen.
  1522.  
  1523. Okay. So we write a lot of action statements containing commands
  1524. that makes Olaf walk, talk, and jump! But how does GRAAL know when
  1525. to use what actions?
  1526.  
  1527. Well, suppose we want to pick up the cup on the barrel. Let's look
  1528. at how that is performed in GRAAL, keeping in mind that GRAAL always
  1529. checks the .room file first, then the .section file, and finally, if
  1530. nothing else helps, the graal.main file! Each file is checked from
  1531. the  top down to the bottom, which is very important to remember in
  1532. order to get the sequence of tests and commands right.
  1533.  
  1534. When the player has clicked PICK UP and the CUP, GRAAL starts
  1535. looking for appropriate ACTION: statements, knowing the number of
  1536. the verb (PICK UP = 2) and the object (the CUP is section object 3, 
  1537. referred to as SOBJ3).
  1538.  
  1539. The first parameter in each ACTION: statement is always the verb
  1540. number, and in 1.room, the first ACTION: 2;... statement that we
  1541. come across is
  1542.  
  1543. ACTION: 2;IFOBJ 1;....
  1544.  
  1545. "IFOBJ 1" is a condition telling us that the rest of this ACTION
  1546. should only be executed if our object was number 1. It wasn't - it
  1547. was SOBJ1 - so we continue to the next statement.
  1548.  
  1549. ACTION: 2;IFOBJ ROBJ1;....
  1550.  
  1551. No luck here, either. We weren't after the plate of spam, known as
  1552. ROBJ1, so we continue, and quickly find that there are no more
  1553. ACTION:s for verb 2 in the room file.
  1554.  
  1555. Switching to the 1.section file, let's see if we are more lucky. No, 
  1556. not a single PICK UP command, actually. This is not so surprising, 
  1557. since almost all objects start out in a certain room.
  1558.  
  1559. Well, why then wasn't there a command to handle the cup in the
  1560. 1.room file? Because, with the power of GRAAL, almost all PICK UPs
  1561. of any "pickable" object can be handled using a few single lines in
  1562. the graal.main file - the two objects especially handled in the
  1563. 1.room file were there because they are handled a little differently
  1564. from most of the rest. Going on to the graal.main file then, we find
  1565. the following:
  1566.  
  1567. ACTION: 2;IFCARR;SAY I Already have it!;EXIT
  1568.  
  1569. IFCARR says that if the object we refer to is already in the
  1570. inventory, then let Olaf say "I already have it!". EXIT means no
  1571. more tests on ACTION statements will be done for our current
  1572. input: The sentence line will be cleared and Olaf is ready to try
  1573. something else.
  1574.  
  1575. However, SOBJ1 is NOT in our inventory yet, so we go on:
  1576.  
  1577. ACTION: 2;IFPICK;MOBJ;HANDLE;W 12;PICK;HANDLE -1;EXIT
  1578.  
  1579. Now behold the true power of the GRAAL. This is the stuff we have
  1580. been tormenting ourselves for all along the tutorial up to this
  1581. point!
  1582.  
  1583. IFPICK; 
  1584.  
  1585. If the object is "pickable"...
  1586.  
  1587. MOBJ; 
  1588.  
  1589. Olaf walks to the default offset position next to the object (as
  1590. specified in the OBJECT: statement for the cup)...
  1591.  
  1592. HANDLE; 
  1593.  
  1594. Olaf stretches out a hand according to the HANDLE_MAP: animation...
  1595.  
  1596. W 12; 
  1597.  
  1598. and waits for about 1/4 of a second...
  1599.  
  1600. PICK; 
  1601.  
  1602. grabs the object (it disappears from the screen and enters the
  1603. inventory list)...
  1604.  
  1605. HANDLE -1; 
  1606.  
  1607. lowers the hand again to the position it had before the
  1608. HANDLE command...
  1609.  
  1610. EXIT; 
  1611.  
  1612. ...and then we are done!
  1613.  
  1614.  
  1615. Now, if our object hadn't been "pickable", the ACTION: used by us
  1616. above are followed by a couple of "safety nets". (Remember, we never
  1617. get to these lines if the object has indeed been picked up - the
  1618. "EXIT" command sees to that.) One example of such a safety net is:
  1619.  
  1620. ACTION: 2;IFTYPE -;SAY That was rather far-fetched, wasn't
  1621.   it?;EXIT
  1622.  
  1623. IFTYPE -; 
  1624.  
  1625. This checks if the referred object was an abstract object, like the
  1626. horizon in the Constantinople harbour. Since abstract objects can't
  1627. very well be picked up under any circumstances, 
  1628.  
  1629. SAY That was rather far-fetched, wasn't it?;EXIT
  1630.  
  1631. makes olaf "speak" this sentence using the talk-map corresponding to
  1632. his current position on the screen, and
  1633.  
  1634. And finally, if the object happens to be un-pickable, but of another
  1635. type, 
  1636.  
  1637. ACTION: 2;SAY I can't pick that up.;EXIT
  1638.  
  1639. gives a rather dull but to-the-point message to the player.
  1640. Don't go erasing ACTIONs in the supplied example graal.main file
  1641. altogether the first thing you do - a lot of these "safety net"
  1642. actions should be in almost any game, although you should of course
  1643. alter the wording and detailed behaviour to suit your own needs!
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651. 8 USING EXITS
  1652. =============
  1653.  
  1654.  
  1655. Now that we are familiar with the general behaviour of ACTION
  1656. statements, it is time to explain how exits work.
  1657.  
  1658. As you may or may not remember, the EXIT: statement in the 1.room
  1659. file defined a "clickable" rectangle on screen. However, we never
  1660. explained what happens when the player clicks the exit.
  1661.  
  1662. This is what happens: GRAAL interprets this as a very special input
  1663. sentence, with the VERB set to 0 and OBJ1 set to the number of the
  1664. exit. It then checks the ACTION statements just as if the player had
  1665. input a normal command. This is a typical ACTION statement to take
  1666. care of an exit command:
  1667.  
  1668. ACTION: 0;IFOBJ 1;MEXIT;GOTO 2,1
  1669.  
  1670. 0; 
  1671.  
  1672. was the verb number indicating an "exit click".
  1673.  
  1674. IFOBJ 1; 
  1675.  
  1676. tests if it was exit number 1 that was clicked.
  1677.  
  1678. MEXIT; 
  1679.  
  1680. is a special command that can only be used in ACTION: 0;...
  1681. statements. It makes the main character move to the exit point
  1682. specified in the EXIT: statement (not to be confused with the EXIT
  1683. *command*, which is something completely different).
  1684.  
  1685. GOTO 2,1
  1686.  
  1687. is a command specifying which room and entrance to go to. Voilà!
  1688.  
  1689. Of course, you are free to do whatever you like in these statements, 
  1690. just like in any other ACTION statement. You may manipulate the way
  1691. exits are interpreted to your heart's content!
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698. 9 THE DACT STATEMENTS
  1699. =====================
  1700.  
  1701.  
  1702. In each room file, there must be at least one DACT statement. The
  1703. DACT statements contain conditions and commands that are run through
  1704. each time the room is entered. The flow of control is the same as
  1705. for ACTION statements - if a condition is not met, the rest of that
  1706. DACT statement is disregarded, and if an EXIT command is
  1707. encountered, no more DACT lines will be checked this time around.
  1708.  
  1709. When GRAAL starts to run through the DACT statements, all graphics
  1710. and objects are already loaded into their proper places. However, 
  1711. the screen is still black - the light switch has not been pushed
  1712. yet, so to speak. This means you can do tests and move things around
  1713. using commands in the DACT statements before you let the player see
  1714. the scene, which is very, very useful. Once you are done preparing
  1715. the scene, simply use a LIGHTS ON command in a DACT statement. When
  1716. an EXIT command is encountered, control is handed over to the
  1717. player.
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724. 10 HAVING A CHAT
  1725. ================
  1726.  
  1727. There is only one major subject we have not discussed at all so far:
  1728. How to talk to other characters in the game.
  1729.  
  1730. In the bar where the game starts, there is a bearded bartender who
  1731. are very likely to become the first person Olaf speaks with. Let's
  1732. look at how this is done.
  1733.  
  1734. First of all, any character involved in conversations must be
  1735. defined as an object using an OBJECT statement in the graal.main
  1736. file. There is nothing special with the definition: Just make sure
  1737. the object cannot be picked up, visible, and placed in the room
  1738. where the dialogue takes place. Also, assign an animation channel to
  1739. it.
  1740.  
  1741. Each dialogue has its own unique number, and is defined by a
  1742. DLG statement in the graal.main file (below the OBJECT statements).
  1743. The  bearded man/bartender dialogue is dialogue number 1, and this
  1744. is the DLG statement:
  1745.  
  1746. DLG: 1;5;11;-20;A 0,(RBOB4,12)(RBOB6,24)...
  1747.  
  1748. 1; 
  1749.  
  1750. means this is dialogue number one.
  1751.  
  1752. 5; 
  1753.  
  1754. means that the object Olaf talks to is global object 5 (the
  1755. bartender).
  1756.  
  1757. 11; 
  1758.  
  1759. is the colour used for the text displayed when the bartender speaks.
  1760.  
  1761. -20; 
  1762.  
  1763. determines how far above the bartender's head the text is displayed.
  1764.  
  1765. A 0,(RBOB4,12)(RBOB6,24)....
  1766.  
  1767. is the animation used when the bartender talks.
  1768.  
  1769.  
  1770. Now that we have two statements in the graal.main file, we move on
  1771. to the 1.room file, where the actual dialogue contents are defined.
  1772.  
  1773. A dialogue always starts when GRAAL encounters a DSET command in an
  1774. ACTION or DACT statement. It then shifts into another mode, where
  1775. the player's input is no longer a normal command sentence, but only
  1776. the number of a dialogue alternative. GRAAL responds to the chosen
  1777. alternative by going through LACT statements that correspond to the
  1778. selected alternative, and does not consider the ordinary ACTION
  1779. statements. Sooner or later, GRAAL encounters an EDLG command in one
  1780. of the LACT statements, which terminates the dialogue and switches
  1781. the game back to the normal input mode.
  1782.  
  1783. Let's begin from the beginning. When the player commands TALK TO 
  1784. BEARDED MAN, the following ACTION line is performed:
  1785.  
  1786. ACTION: 5;IFOBJ 5;IFOF 1=0;MOBJ;SAY Hello;RESP R,1,Hello,yourself; 
  1787.   DSET 1,+3,+7,+9,+11;EXIT
  1788.  
  1789. 5; 
  1790.  
  1791. the verb is TALK TO - we have a match
  1792.  
  1793. IFOBJ 5; 
  1794.  
  1795. the object is the BEARDED MAN/BARTENDER - we still have a match
  1796.  
  1797. IFOF 1=0; 
  1798.  
  1799. Hello, what's this? It's a test of an object flag, a concept we have
  1800. not discussed earlier. Object flags are variables attached to each
  1801. object. There are six flags for each object, and each can have any
  1802. numerical, integer value. By assigning values to flags and testing
  1803. them, you can keep track of everything that has happened to an
  1804. object - it's up to you to decide what to use the flags for. In this
  1805. case, I have decided to use flag 1 for the bartender to see if this
  1806. is the first time ever we talk to him. All flags are initially 0, so
  1807. this test - IFOF 1=0 - is true in our case. Before the dialogue is
  1808. ended, the flag values will be set to 1 to indicate that next time
  1809. around, we should resume the conversation in a slightly different
  1810. manner.
  1811.  
  1812. OK, on with it:
  1813.  
  1814. MOBJ; 
  1815.  
  1816. We move up to the bartender just like we move up to any object
  1817. before manipulating it.
  1818.  
  1819. SAY Hello; 
  1820. Say "Hello".
  1821.  
  1822. RESP R,1,Hello, yourself.; 
  1823.  
  1824. This is the bartender's response. "1" means GRAAL will look up the
  1825. statement DLG: 1;... in the graal.main file to find out how the
  1826. bartender behaves when talking. "R" means the default bartender
  1827. animation will resume as soon as the talking is over.
  1828.  
  1829. So far, all statements have been performed with the game still in
  1830. the "normal" mode. Now comes the command which switches to dialogue
  1831. mode:
  1832.  
  1833. DSET 1,+3,+7,+9,+11; 
  1834.  
  1835. This command engages us in dialogue number one and tells GRAAL to
  1836. add the four dialogue alternatives 3, 7, 9, and 11 to the list of
  1837. possible lines for Olaf to speak. Since this is the first DSET
  1838. statement ever to be performed for dialogue one, they will be the
  1839. ONLY four alternatives.
  1840.  
  1841. EXIT
  1842.  
  1843. exits the parsing of the TALK TO command, and leaves us to get on
  1844. with the dialogue - the player now has to select a dialogue line
  1845. from the dialogue area which has replaced the normal control area.
  1846.  
  1847.  
  1848. Hmm. Dialogue lines 3,7,9, and 11. What are they? All the lines are
  1849. defined by LINE statements in the 1.room file. Let us take line 3 as
  1850. an example:
  1851.  
  1852. LINE: 1;3;What is this place?;Where did you say I was?; 
  1853.  
  1854. 1;3; 
  1855.  
  1856. means this is line 3 of dialogue 1
  1857.  
  1858. What is this place?; 
  1859.  
  1860. This is the line appearing in the dialogue command area (where the
  1861. player can choose a line to say) when the alternative is previously
  1862. unused.
  1863.  
  1864. Where did you say I was?; 
  1865.  
  1866. is the version that will appear if the alternative is "re-used". If
  1867. this second version is specified as a blank space only, the first
  1868. version of the sentence will always be used.
  1869.  
  1870. "one blank space"
  1871.  
  1872. The last semi-colon is followed by one, very important blank space, 
  1873. which tells GRAAL there are no conditions attached to this dialogue
  1874. line.
  1875.  
  1876. To explain the concept of dialogue conditions, let's look at another
  1877. of the initially added lines, line 7. The definition of that LINE
  1878. goes:
  1879.  
  1880. 1;7;Do you know anything about the ship in the harbour?; ;IFOF 2=1
  1881.  
  1882. First of all, notice there is no second version of this line. The
  1883. question will always look the same, regardless of how many times
  1884. Olaf puts it to the poor bartender.
  1885.  
  1886. Here, there is an additional condition that determines whether this
  1887. dialogue alternative is available to Olaf or not. Object flag 2 for
  1888. the bartender must be set to 1, otherwise the line will not appear
  1889. in the dialogue command area, no matter how many "DSET 1,+7"
  1890. commands are issued. However, once a DSET 1,+7 command has been
  1891. given, line 7 becomes a possible line: GRAAL will check object flag
  1892. 2 for the bartender each time the dialogue is re-engaged or
  1893. refreshed, and as soon as flag 2 becomes 1, the line will appear and
  1894. become available for Olaf to speak.
  1895.  
  1896. If you look through the lines, you will notice that only lines 3 and
  1897. 11 are unconditional. This means that if the first thing Olaf does
  1898. is engage in conversation with the bartender, only those two
  1899. alternatives will be visible. So what the player now sees in the
  1900. command area is:
  1901.  
  1902. What is this place?
  1903. My head hurts.
  1904.  
  1905. However, if he (which is unlikely) trundles off to the harbour to
  1906. look at the ship, and only then returns to talk to the bartender, 
  1907. line 7
  1908.  
  1909. Do you know anything about the ship in the harbour?
  1910.  
  1911. is also available.
  1912.  
  1913.  
  1914. OK, back to our poor player, currently facing the task of choosing a
  1915. sentence to speak.
  1916.  
  1917. When the player clicks one of the alternatives, the corresponding
  1918. line number is sent back to GRAAL. Let's assume the player clicks on
  1919.  
  1920. My head hurts.
  1921.  
  1922. This means the number "11" is returned. GRAAL now starts to search
  1923. for LACT statements starting with 1;11; - there had better be one, 
  1924. or nothing will happen! Fortunately, there is:
  1925.  
  1926. LACT: 1;11;RESP R,1,That's probably because...;DSET 1,N11
  1927.  
  1928. This is a typical example of a simple response to a dialogue line.
  1929. The bartender speaks, and then another DSET command is given.
  1930. Because we already are in dialogue mode, this command only
  1931. "refreshes" the dialogue - that is, makes alterations to the current
  1932. set of valid alternatives. In this case, the adjustment is to take
  1933. away line 11 and tell GRAAL that it should never been shown again.
  1934. That's what "N11" means.
  1935.  
  1936. Assuming Olaf hasn't been out exploring the town yet, he is now left with
  1937. only one alternative - the line
  1938.  
  1939. What is this place?
  1940.  
  1941. The response to this one is a bit more substantial. The bartender
  1942. makes a long response - so long, in fact, that is does not fit into
  1943. one LACT statement with ease. Instead, there are two statements, 
  1944. performed in sequence. When using this technique, remember NOT to
  1945. put an EXIT or DSET command at the end of the first statement, 
  1946. because that would interrupt the process and prohibit the second
  1947. statement from being executed!
  1948.  
  1949. In the process, the bartender - if he is still named "bearded man" -
  1950. reveals his identity. Therefore, there is a
  1951.  
  1952. NAME bartender; 
  1953.  
  1954. command, renaming object 5 "bartender" if it has not been done
  1955. already.
  1956.  
  1957. The response ends with DSET 1,+1,+2,+5. This means that three more
  1958. possible alternatives will be added to the set of lines available to
  1959. Olaf, all of which are unconditional. The current alternative - line
  1960. 3 - also remains, but now appears in its alternative form "Where did
  1961. you say I was?". This makes the conversation a bit more believable, 
  1962. since you usually rephrase your questions when you feel you need to
  1963. repeat them.
  1964.  
  1965. One of the added alternatives, line 1, is an "end-of-conversation"
  1966. alternative. When Olaf says "Thank you very much", the bartender
  1967. answers "Don't mention it.". Then, 
  1968.  
  1969. EDLG;EXIT
  1970.  
  1971. is performed, which switches the game back to normal input mode. As
  1972. you se in the LACT statement, object flag 1 for the bartender is set
  1973. to 1 to indicate that if we TALK TO the bartender again, it is a
  1974. resumed conversation - the initial "hellos" will be expressed a bit
  1975. differently.
  1976.  
  1977. See the on-line reference for information about the SETOF command.
  1978. We can use the simple form of the SETOF statement to set the
  1979. bartender flag because all throughout a dialogue, OBJ1 points to the
  1980. object we talk to. OBJ1 is normally the first object pointed to by a
  1981. command sentence. In other words, after we specify
  1982. TALK TO BARTENDER, OBJ1 remains pointing to the bartender until we
  1983. resume normal input mode again.
  1984.  
  1985.  
  1986. This concludes the basic tour of the features available in GRAAL
  1987. 1.0, but stay tuned: Below are a lot of hints and tips about how to
  1988. use the power and special techniques of GRAAL to their full
  1989. potential.
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996. 11 MASTER CLASS: CHARACTER AND GRAPHICS DESIGN
  1997. ==============================================
  1998.  
  1999. Well, fellow adventurer, by now you are a proficient GRAAL user.
  2000. I hope. Anyway, welcome to the first master class, where we will
  2001. look at some of the central GRAAL concept a bit more closely.
  2002.  
  2003. This chapter deals with designing your main character and planning
  2004. your graphics, something that must be done with some thought and
  2005. consideration - although small adjustments are easy to make at any
  2006. stage during the game development, things like the character size
  2007. influence every other piece of graphics you create, so beware!
  2008.  
  2009.  
  2010. 11.1 SIZE
  2011. ---------
  2012.  
  2013. Get a suitable character size, keeping the backgrounds in mind -
  2014. they are 120 pixels high, and in lowres, so you must use lowres when
  2015. designing too - otherwise your hero will look rather fat on the
  2016. screen! I should think a character between 40 and 60 pixels high
  2017. would be about right. Below 40 and there is not much room for detail
  2018. at all, more than 60 and the scenes start to feel cramped because
  2019. the character takes up too much space. Also, bigger graphics takes
  2020. more processing power.
  2021.     
  2022. In addition, the more pixels you have to animate, the more chances
  2023. you have of making a bad job of it! Really, I am not kidding. Small
  2024. can be beautiful sometimes.
  2025.  
  2026. Naturally, how you want the backdrops to relate to the main
  2027. character is also a factor - is he a small guy in a big, cruel
  2028. world, or an ace detective always moving around in cramped Victorian
  2029. tunnels and Baker Street studies?
  2030.  
  2031.  
  2032. 11.2 COLOUR
  2033. -----------
  2034.  
  2035. Use only some of the available colours for your character, and make
  2036. it a good spread of useful colours, because these colours will have
  2037. to be the same in all scenes!
  2038.  
  2039. Colours not used for portrayal of the main character, or frequently
  2040. occurring objects, can change according to the current scene - the
  2041. more colours you have left to play with, the more variation you can
  2042. bring to the backdrops.
  2043.  
  2044. Note: The first three colours more or less have to be as follows:
  2045. Colour 0 should always be used ONLY for transparent areas in BOB
  2046. images. Colour 1 SHOULD be a rather bright white, colour 2 MUST be
  2047. black!!
  2048.  
  2049. Here's a tip: When working with a background or clip-art picture in
  2050. a paint program, set colour 0 to something strange to distinguish it
  2051. from "usable" colours, but always set it back to black before
  2052. saving, or the borders around the adventure scenes when running the
  2053. adventure may become coloured in ways that we don't want! If you
  2054. don't follow this advice, you surely will make the mistake of using
  2055. colour 0 as the black colour in spots of the graphics, whereas it
  2056. will be transparent when used in the game - and vice versa!
  2057.  
  2058. Despite the fact that you should only use some colours for the
  2059. character, always create the graphics with a 32-colour palette (=5
  2060. bitplanes).
  2061.  
  2062.  
  2063. 11.3 DESIGNING ANIMATIONS
  2064. -------------------------
  2065.  
  2066. The following poses must be designed for the main character:
  2067.  
  2068. * The stills to use for front, back and "sideways facing left"
  2069.   still poses.
  2070.  
  2071. * The animations for walking towards, away, and sideways right to
  2072.   left.
  2073.  
  2074. * The animations for talking corresponding to the front, back and
  2075.   side stills. (Open and close the mouth in different ways, move
  2076.   the head slightly, etc.)
  2077.  
  2078. * The animations or stills used for handling objects (picking up, 
  2079.   handing over, etc.), also corresponding to the three "main
  2080.   stills" previously mentioned, but in three different heights for
  2081.   each still - High, Middle and Low, depending on whether the
  2082.   object is located on the floor, high up or on a table or
  2083.   something else in "mid air".
  2084.  
  2085. The reason you don't have to make separate animations and images for
  2086. right and left is that you can mirror one image to point in the
  2087. other direction using a simple trick described further on. This
  2088. saves memory as well as time spent in paint programs!
  2089.  
  2090. To get the animation smooth, it should be designed to work with
  2091. frame updating taking place every 6th vertical blank. This may sound
  2092. like nonsense to you, but what it means is that you can switch the
  2093. animation cel every six 50ths of a second, which equals six frames
  2094. displayed on a PAL TV system (or 60ths of a second on an NTSC
  2095. system).
  2096.  
  2097. Actually, too many animation cels for a certain movement may not
  2098. necessarily add that much to the game anyway. Olaf uses only 5 cels
  2099. for a basic walking movement, each cel being shown for 6 50ths of a
  2100. second.
  2101.  
  2102. So, now you should have you basic animations designed. Good. First, 
  2103. test them against some different backdrops that you think will be
  2104. representative for the game in your excellent paint program.
  2105.  
  2106. Then, satisfied that your character basically looks OK, you should
  2107. now design a "dummy room" in GRAAL, place some "dummy objects" in
  2108. that room that will force your character to use all his newly
  2109. learned physical skills. Then, give him a good work-out.
  2110.  
  2111.  
  2112. 11.4 ALL ABOUT 3D AND HOTSPOTS
  2113. ------------------------------
  2114.  
  2115. GRAAL rooms are usually displayed in a "simulated 3D" perspective
  2116. (although top-down views can be achieved). This basically means
  2117. that the things slightly higher up the picture seem "further away"
  2118. than the tings towards the lower end of the picture. Take the
  2119. harbour in "Olaf" as an example: When Olaf walks towards the water
  2120. and the edge of the quay, he's actually only moving a number of
  2121. pixels up the screen - there is no such thing as "away", because the
  2122. screen can never really be anything but 2D.
  2123.  
  2124. This simple fact allows us to play with foreground and background
  2125. objects. Anything placed towards the bottom of the screen will, generally
  2126. speaking, be "in front". I'm talking about objects as well as STATIC: and
  2127. ANIM: images now, mind you - everything drawn directly onto the
  2128. background picture will naturally always be part of the background!
  2129.  
  2130. So, as a rule anything lower down goes "in front" of anything further up, 
  2131. but that's not necessarily the way we want people to perceive things -
  2132. take the mug on top of the barrel in the bar, for instance. Looking only
  2133. at the placement of the images of the mug and the barrel, the mug should
  2134. logically be partly hidden by the barrel, because it is further up the
  2135. picture. It's not. Instead, it looks like it is placed ON the barrel, 
  2136. which is what we want. Also, when Olaf walks behind the barrel, he must
  2137. also walk behind the mug - if the mug is on the barrel but Olaf seems
  2138. to be walking in front of the mug but behind the barrel, everything
  2139. becomes hideously unrealistic.
  2140.  
  2141. The answer to this problem? It's simply a matter of setting each image's
  2142. hotspot correctly. The hotspot is the point of each image that tells
  2143. which point of the image will actually be placed at the x and y
  2144. coordinate specified for an object.
  2145.  
  2146. Each image has its own hotspot, and it is normally set when the image is
  2147. loaded with a ...BOBS: statement (the last parameter - look it up in the
  2148. reference). The GRAAL default is to place the hotspot at the middle of
  2149. the bottom edge of the image - you might say at the "foot" of the image.
  2150. This is normally very appropriate, especially so for people and living
  2151. objects. But you can place the hotspot anywhere you like - if you specify a
  2152. value other than the default, the hotspot will be offset in the y direction
  2153. that number of pixels from the top edge of the image. Both negative and
  2154. positive values are allowed.
  2155.  
  2156. Study the ROOMBOBS: statement for the mug image in room one, compare that
  2157. to the mug's x and y position in the OBJECT: statement in graal.main, and
  2158. you will see that the hotspot is placed well below the actual image, making
  2159. it the "frontmost" object in the bar.
  2160.  
  2161. The hotspot of an image can also be altered using the HOTSP command -
  2162. this is used in some cutscenes dealing with the ship in the harbour, 
  2163. to switch the depth-placing of the sail. This is because the captain
  2164. first walks behind the sail, but when summoned ashore, he suddenly has
  2165. to go in front of it! The solution? Just alter the sail's hotspot...!
  2166.  
  2167.  
  2168.  
  2169.  
  2170. 12 MASTER CLASS: CUTSCENES
  2171. ==========================
  2172.  
  2173.  
  2174. CUTSCENES are simply script files (suffixed with .scene) that contain
  2175. nothing but commands. That's right - no conditions, and no statements!
  2176. This means lines should NOT start with ACTION: or anything like that -
  2177. just fire away with the command name in column one of each line!
  2178.  
  2179. The immense usefulness of cutscenes may not be apparent at first, 
  2180. but you will soon find out that you use quite a lot of them -
  2181. because in addition to being used for "movie scenes", they are also
  2182. very handy whenever you have a sequence of GRAAL commands that you
  2183. need to use in a lot of different places. In these cases, cutscenes
  2184. can act the way procedures or subroutines do in ordinary programming
  2185. languages. In those cases, you must make sure all of the cutscene is
  2186. executed, and you probably don't want to show the cutscene indicator
  2187. to the player. It's easy enough - just read on!
  2188.  
  2189. The logic of cutscenes ought to be a fairly simple subject, since
  2190. there are no conditions allowed in them! In practice, two things
  2191. require you to think very carefully about designing your cutscenes:
  2192. The "skip" function (pressing the <Esc> key to jump past a cutscene)
  2193. and nested cutscenes.
  2194.  
  2195.  
  2196. 12.1 HOP, SKIP AND JUMP
  2197. -----------------------
  2198.  
  2199. Normally, a cutscene consists of two parts: The main part at the
  2200. top, always containing ALL the actions in the scene, and the FINAL
  2201. section at the end.
  2202.  
  2203. The FINAL section is ONLY used if the <Esc> key was pressed during
  2204. execution of the main part. It must duplicate all statements
  2205. necessary to set the scene exactly the same way it would have been
  2206. set if the main part had been run through completely. Remember, you
  2207. never know exactly where in the flow of the main part the player
  2208. decides to press <Esc> and breaks out of the action!
  2209.  
  2210.  
  2211. 12.2 NO BREAKS!
  2212. ---------------
  2213.  
  2214. In some circumstances, for example when you use cutscenes as
  2215. "subroutines" as discussed above, you may not want the skip option
  2216. to be in effect. In this case, start the entire cutscene with the
  2217. cutscene statement NOBREAK, which disables the <Esc> key for the
  2218. duration of the cutscene. If a cutscene starts with NOBREAK, you
  2219. don't need a FINAL section in it.
  2220.  
  2221.  
  2222. 12.3 NESTING
  2223. ------------
  2224.  
  2225. Now, to complicate things even further, cutscenes may be nested in
  2226. up to three levels - that is, you can execute a cutscene within a
  2227. cutscene from within a cutscene!
  2228.  
  2229. "Why on earth would I want to do that?" you ask. Well, a good
  2230. example is the harbour scene in room 3 of "Olaf". There are a number
  2231. of occasions when Olaf needs to interact with the captain, calling
  2232. him ashore time and time again. The captain's going ashore and
  2233. aboard can not be handled as simple PTRN sequences, because he, the
  2234. ship itself, and the sail need to be rearranged in various ways to
  2235. make the captain go behind the sail, in front of the sail but behind
  2236. the gangplank, etc.
  2237.  
  2238. Therefore, the captain going ashore is played using one cutscene, 
  2239. the going aboard in another (well, actually two, depending on
  2240. whether his hat is secured with the rubber band or not). These
  2241. cutscenes are then used from within, or in conjunction with, a
  2242. number of others specifying what is going on when the captain comes
  2243. ashore to talk to Olaf.
  2244.  
  2245. Let us call the first cutscene the "master scene" and those called
  2246. from within that "sub-scenes". Now, what we have to watch out for is
  2247. this:
  2248.  
  2249. If we press <Esc> at the very beginning of the master scene, or
  2250. indeed anywhere before the last sub-scene, this means some of the
  2251. sub-scenes will not come into play at all. However, the contents in
  2252. each sub-scene may affect how the game should be set up at the end
  2253. of the master scene.
  2254.  
  2255. To conclusion is that the FINAL section of the master scene also
  2256. must include all statements that are present in the FINAL sections
  2257. of the relevant sub-scenes. Let's look at Olaf and the captain
  2258. again, when Olaf tries to use the dictionary on the captain and gets
  2259. it all wrong. This is depicted in CUTSCENE 13 structured like this:
  2260.  
  2261. 1. First, CUTSCENE 2 is called as a sub-scene to make the captain
  2262.    come ashore.
  2263.  
  2264.    Note: Sub-scenes should always be called with parameter ,F to
  2265.    stop the cutscene indicator symbol flickering on the screen. The
  2266.    master scene should be called with parameter ,S because when
  2267.    it's finished, the whole scene is finished.
  2268.  
  2269. 2. Then, Olaf tries to speak hindi or something like that, and gets
  2270.    punched out.
  2271.  
  2272. 3. While Olaf is still on the ground recovering, CUTSCENE 3 is
  2273.    invoked to put the captain back aboard the ship.
  2274.  
  2275. 4. Once the captain is back aboard, Olaf gets up and notes that the
  2276.    whole endeavour wasn't particularly successful.
  2277.  
  2278. 5. The FINAL section of the master scene CUTSCENE 13 then needs to
  2279.    contain the following: The commands from the FINAL section of
  2280.    CUTSCENE 3, because those make sure the captain is back in place
  2281.    aboard the ship, and some commands to put Olaf back on his feet
  2282.    in the right position. We do NOT have to bother about anything
  2283.    in CUTSCENE 2, because the captain's coming ashore does not have
  2284.    anything to do with how things look after the master scene is
  2285.    finished.
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293. 13 MASTER CLASS: SPECIAL TECHNIQUES OR
  2294. "HOW THE HECK DID HE DO THAT?"
  2295. =======================================
  2296.  
  2297.  
  2298. This is a walk-through of some of the particularly clever stuff in
  2299. the Olaf script files. I hope it goes to prove that I have tried not
  2300. only to solve specific "Olaf" problems when writing GRAAL, but
  2301. provided a set of commands that are flexible enough to allow even the
  2302. nearly impossible to be done without an endless array of novelty gadgets
  2303. of limited use.
  2304.  
  2305.  
  2306. 13.1 SPEAKING IN A FOREIGN TONGUE
  2307. ---------------------------------
  2308.  
  2309. The conversation with Rajah Singh on the quay is rather special -
  2310. you are forgiven for thinking a special font is being used to
  2311. display the foreign language of Rajah. However, this is not the
  2312. case. Instead, I have combined a "blank" RESP command with BOBON and
  2313. BOBOFF commands. Have a look in the 3.room file:
  2314.  
  2315. First, the "foreign language" was "written" in an ordinary picture
  2316. (3FG.IFF) using DPAINT.
  2317.  
  2318. Then, the "words" were grabbed as RBOBs using ROOMBOB statements.
  2319.  
  2320. Rajah's responses to Olaf dialogue lines are as follows:
  2321.  
  2322. First, a BOBON command is used to display the RBOB with the "foreign
  2323. language".
  2324.  
  2325. Immediately upon that, a RESP command displaying nothing but blank
  2326. spaces is used to make Rajah Singh "speak".
  2327.  
  2328. After that, a BOBOFF takes away the strange text again. Simple, eh?
  2329. No need to construct an entire font (and no need for another GRAAL
  2330. command to handle that font!).
  2331.  
  2332.  
  2333. 13.2 AN AUTOMATED ROOM
  2334. ----------------------
  2335.  
  2336. As you may have noticed, you can never get into normal game mode in
  2337. Ali Harrod's shop - As soon as you walk in, you end up in dialogue
  2338. mode, and when you end the dialogue, you are immediately transported
  2339. out of the boutique. This is thanks to the DACT statements, where
  2340. the programmer can grab control and keep it for as long as he likes!
  2341. Have a look in 4.room - there is not a single run-through of DACT
  2342. statements that does not end with a DSET... EXIT combination, 
  2343. forcing the player into dialogue mode. Therefore, there are no ACTION:
  2344. statements either.
  2345.  
  2346. This technique is useful in a lot of circumstances - many times, it
  2347. relieves you of having to think out a lot of elaborate ideas for a
  2348. room where you really don't want the player prowling around.
  2349.  
  2350.  
  2351. 13.3 THE ART OF AVOIDING A SEAGULL
  2352. ----------------------------------
  2353.  
  2354. As long as the seagull in the harbour is sitting on the pollard, 
  2355. Olaf steers well clear of it when walking about. He simply walks
  2356. where the room file FLOOR: statements say he can move!
  2357.  
  2358. However, as soon as the seagull is scared off, Olaf is free to
  2359. approach the pollard and pick up the feather. This is made possible
  2360. by two FLOOR and one NFLOOR command executed in the cutscene where
  2361. the seagull takes off (4.scene).
  2362.  
  2363. Having chased the seagull away, one problem remains: The next time
  2364. we re-enter the room, we want things to be the way they are now, and
  2365. not according to how they are set up in the room file statements.
  2366.  
  2367. A room flag comes to the rescue here - it allows us to "remember"
  2368. the seagull status between visits to the room.
  2369.  
  2370. Room flag 1 for the room (room 3) is used - as long as it is zero
  2371. (the initial state), the seagull is on the pollard. As soon as the
  2372. bird is scared off, we set the flag to 1 with a SETRF 1=1 command in
  2373. the cutscene. This room flag is tested in a DACT: statement - if it
  2374. is set to 1, the bird is moved to the roof of the shed, and the default
  2375. floor definitions are changed exactly the same way as in cutscene 4.
  2376.  
  2377. Remember, as long as the LIGHTS ON command has not been used, the scene
  2378. remains black and we can move anything we want around without the player
  2379. being aware of what is done!
  2380.  
  2381.  
  2382. 13.4 A SPITTING IMAGE
  2383. ---------------------
  2384.  
  2385. The spitting llama on offer by Ali Harrod is composed of two
  2386. animations, because I decided a single one would be too large.
  2387. Instead, the llama itself is one animation, and the "spit" is
  2388. another, very small one, animated by an AMAL "Move" command.
  2389.  
  2390. The movement of the llama and spit animations are synchronised - the
  2391. llama being displayed on top of the spit. (Well, almost synchronised.
  2392. If you leave the llama sequence on and walk away for a quarter of an
  2393. hour, you will notice that things have become a little strange when
  2394. you return. But who could keep away from the game that long, anyway?
  2395. And if you don't like it, you can always make one big animation of
  2396. the whole thing!)
  2397.  
  2398.  
  2399. 13.5 A MAP ROOM
  2400. ---------------
  2401.  
  2402. I had planned on only delivering the first four rooms with GRAAL, 
  2403. but ended up giving you seven. The reason is some quite interesting
  2404. techniques were used in rooms 5 and 7, which may come in handy.
  2405.  
  2406. Room 5 is an outline map of the East, showing the towns of
  2407. Constantinople, Gurgan and Baghdad. The thing is, there is no Olaf, 
  2408. and nothing to do except watch a short cutscene and, when
  2409. revisiting, point to one of the three towns.
  2410.  
  2411. Olaf was done away with by a simple CHAR OFF command in a DACT
  2412. statement - nothing strange about that (once you read the on-line
  2413. reference). Remember that the main character will always be made
  2414. visible when entering a new room, unless you put it away again with
  2415. CHAR OFF.
  2416.  
  2417. There are no objects in the room, and although you can try to
  2418. manipulate the objects in the inventory, whatever happens will not
  2419. get through to you, because Olaf is not there to tell you about it.
  2420. However, three small exits placed just over the towns on the map
  2421. provide three ways to get on with the game.
  2422.  
  2423. I have chosen to display the exit names the normal way, although I
  2424. might just as well have put a blank space instead of names in the
  2425. EXIT statements - the names of the towns are written on the map, and
  2426. it shouldn't have taken the player too long to figure out where to
  2427. click, anyway.
  2428.  
  2429.  
  2430. 13.6 A SMALL GUY
  2431. ----------------
  2432.  
  2433. Character scaling is not well supported in GRAAL at the moment, but
  2434. thanks to the system's flexibility, you can (partially) ignore that!
  2435. To prove it, I have made a big Baghdad panorama in room 7, requiring
  2436. Olaf to be shown at half the normal size.
  2437.  
  2438. Tough job? Not very. The secret is the BOBS command, which can be
  2439. used to switch the global BOB images to a new size. I simply took
  2440. the Olaf_Original.IFF picture containing the standard animations for
  2441. Olaf, halved its size, and re-saved it under a different name. When
  2442. Olaf arrives at Baghdad, all graphics are replaced using BOBS
  2443. commands and the new picture CLPART file. In addition, for this
  2444. sunset scene I also altered the colour scheme for the Olaf images
  2445. slightly. It blends better with the background picture that way.
  2446.  
  2447. There is one problem here which you must be aware of:
  2448. Loading saved games does not restore global BOB images.
  2449.  
  2450. So, if you are in Baghdad (Olaf small) and load a saved game placing
  2451. him in, for example, room 2, he will still be small. Or would be, if
  2452. we did not do anything about it.
  2453.  
  2454. Well, this is not too difficult to take care of. In each "normal"
  2455. room, you simply have to keep track of whether you need to reload
  2456. the global BOB images affected - a couple of commands in a DACT
  2457. statement for each room where Olaf should be his normal self is
  2458. enough.
  2459.  
  2460. To achieve this, and keep track of Olaf's looks, I used a room flag
  2461. belonging to room 0. Room 0 is a "dummy" room which is never used in
  2462. a game, so there are actually 20 excellent "global" room flags
  2463. there, which can be used to keep track of "global game states".
  2464.  
  2465. So, if room flag 1 for room 0 is 1, (i.e. IFRF 0,1=1), Olaf needs a
  2466. change of clothes. The change is taken care of by some BOBS
  2467. statements in a cutscene file, restoring the original BOB images.
  2468. And that's that. Check out the appropriate DACT statement in room 1, 
  2469. 2, 3, 4 or 6 and the cutscene file mentioned there to see what it
  2470. looks like.
  2471.  
  2472. (Hope you didn't ask why there is no code to restore Olaf in room 5.
  2473. It's because Olaf is never shown there, remember? :)
  2474.  
  2475.  
  2476.  
  2477. 14 MASTER CLASS: HINTS AND TIPS
  2478. ===============================
  2479.  
  2480. Here are some general hints and tips that may prove useful.
  2481.  
  2482.  
  2483. 14.1 FLAGS
  2484. ----------
  2485.  
  2486. * Avoid setting flags in cutscenes, if you have a choice. It's hard to
  2487.   keep track of the games' status in the main script files if the
  2488.   setting of flags is "hidden from sight" in the cutscenes. (And
  2489.   forget I mentioned I've done just the opposite in a few places. Do
  2490.   as I say, not as I do! :-)
  2491.  
  2492. * Since all variables have the initial value 0, it is good practice to
  2493.   let that value represent the initial state of the object, room, 
  2494.   situation, etc.
  2495.  
  2496. * Use room flags for all things that relate to the scene as a whole, 
  2497.   rather than the flags of a particular object.
  2498.  
  2499. * Condition-dependent dialogue alternatives may often be set up using
  2500.   the object flags for the dialogue partner (who is always defined as
  2501.   a global object in the graal.main file).
  2502.  
  2503. * Remember that ALL aspects of room objects and section objects get reset
  2504.   as soon as you leave the room or section. You can compensate for this
  2505.   using room flags to track room object states, and then set the objects
  2506.   up in whatever way they should be by using DACT statements.
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513. 15 QUESTIONS AND ANSWERS
  2514. ========================
  2515.  
  2516.  
  2517. Q: Anything I should think about when assigning BOB numbers to
  2518.    objects?
  2519.  
  2520. A: Use numbers below 60. Make sure a BOB number is never used for
  2521.    more than one thing at a time in the same room. Otherwise, no: No
  2522.    information is connected to or "belongs to" BOB numbers and their
  2523.    use, so there are no other fixed rules.
  2524.  
  2525.  
  2526. Q: What about animation channels then?
  2527.  
  2528. A: Same thing. Look up the reserved channel numbers in the on-line
  2529.    reference, and make sure you never try to use the same channel for
  2530.    two things in the same room!
  2531.  
  2532.  
  2533. Q: What are the rules for room object use?
  2534.  
  2535. A: A room object can only exist in one room - therefore, it can
  2536.    never be picked up or added to the inventory. Nor may you use its
  2537.    object flags for very much, because they will be reset each time you
  2538.    exit the room.
  2539.  
  2540.    ROBJ references should only exist in .room files, never in .sect or
  2541.    graal.main!
  2542.  
  2543.  
  2544. Q: What are the rules for section object use?
  2545.  
  2546. A: A section object only exists within one section, and preferably
  2547.    disappears totally during the first visit to the section -
  2548.    otherwise, you must keep track of how the objects have been handled
  2549.    via room flags or such devices, if you happen to re-enter the
  2550.    section.
  2551.  
  2552.    In other words, take particular care if your adventure is designed
  2553.    in such a way that you can go back to, for example, section 1 from
  2554.    section 2 - not only must you be sure that section 1 still looks
  2555.    okay with respect to section object use, but also, the section 2
  2556.    section objects will suffer the same problems! Even if you haven't
  2557.    "solved" section 2 yet completely, going back to section 1 will end
  2558.    your first visit to section 2 and thus reset your section objects for
  2559.    section 2!!
  2560.  
  2561.    SOBJ references should only be used in .room and .sect files, not in
  2562.    the .main file.
  2563.  
  2564.  
  2565. Q: My tunes play in a strange tempo!
  2566.  
  2567. A: GRAAL only supports the "old" soundtracker tempo format of "ticks" -
  2568.    the primary tempo should always be 33, and the secondary can be
  2569.    altered using tracker commands to achieve the desired tempo. (Between
  2570.    5 and 7 is usually good.) Any attempt to use BPM settings instead will
  2571.    get you into trouble for sure.
  2572.  
  2573.  
  2574. Q: After playing a tune with the TRACK command, samples played with the
  2575.    SAM command get caught in a loop!
  2576.  
  2577. A: Naughty you - you have used an undocumented feature of GRAAL! It CAN
  2578.    play med modules (MMD0 and MMD1 formats), provided you have the file
  2579.    extension ".med" in the module name. However, this causes the above bug
  2580.    in the sample routines to appear - this is Amos's fault. I know there
  2581.    exists an Amos bugfix or work-around for this, but I haven't got it.
  2582.    If anyone has seen it, mail it pronto, and the med support will be made
  2583.    official!
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.                             APPENDICES
  2590.                             ==========
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596. APPENDIX A: THE ON-LINE MONITOR
  2597. ===============================
  2598.  
  2599. GRAAL_DEV is equipped with an on-line monitor able to show you the
  2600. values of all flags and states of all objects. Simply press the [G]
  2601. key during testing, and voilà - a screen drops down covering
  2602. everything else.
  2603.  
  2604. The monitor has three sections: Object, Room and Dialogue Control. You
  2605. will use the Object and Room Control most frequently. Let's go through
  2606. it all one step at a time:
  2607.  
  2608.  
  2609. A.1 OBJECT CONTROL
  2610. ------------------
  2611.  
  2612. All current objects - that is, the global objects and the objects for
  2613. the current section and room - are shown in the list. Click on one to
  2614. select it, and information about its location and value for flag 1 is
  2615. shown in the other fields and gadgets.
  2616.  
  2617. To see the values for the other object flags, click on the "Flag"
  2618. cycle gadget. To set a new value for a flag, enter a new value in the
  2619. "Value" fields, and click the "<-Set" button.
  2620.  
  2621. The best way to add objects to the inventory is to select the object
  2622. in the list and the click the "<-Pick" button. This sets the room to
  2623. 999, which is the room used for the inventory.
  2624.  
  2625.  
  2626. A.2 ROOM CONTROL
  2627. ----------------
  2628.  
  2629. When you call the monitor, the Room and Entrance fields show the room
  2630. and entrance numbers used in the last GOTO command.
  2631.  
  2632. To switch to a new room, type the room number in the Room field and
  2633. press [Enter]. Note that only by pressing [Enter], the data for the
  2634. desired room will be available in the flag Value field.
  2635.  
  2636. To set a new flag value for a room flag, proceed the same way as with
  2637. object flags.
  2638.  
  2639. One of the best things about the monitor is that it allows you to jump
  2640. instantly to any room and entrance you desire during testing. Simply
  2641. type in the room and entrance numbers, and the press the "<-Goto"
  2642. button. The monitor will disappear and the selected room will be
  2643. loaded.
  2644.  
  2645. If you have set MAX_CACHE to 0, using "<-Goto" is also a very handy
  2646. way of reloading a room script - pressing "<-Goto" without changing
  2647. rooms will still reload the room script, and that will force any
  2648. changes to take effect immediately.
  2649.  
  2650.  
  2651. A.3 DIALOGUE CONTROL
  2652. --------------------
  2653.  
  2654. To be honest, I haven't used this option that much. Basically, it
  2655. allows you to investigate the status of the lines in a dialogue -
  2656. which could be handy at times, because it is the line state that
  2657. determines whether a dialogue line is able to pop up in the set of
  2658. dialogue lines.
  2659.  
  2660.  
  2661. A.4 BACK TO GRAAL
  2662. -----------------
  2663.  
  2664. The "Back to GRAAL" button quits the monitor and returns control to
  2665. the game. If any changes were made to flag values etc. in the monitor, 
  2666. GRAAL will reload the current room. This is because changes may affect
  2667. the way objects and stuff in general are set up in the DACT
  2668. stataements.
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675. APPENDIX B: "PRODUCTIFYING" YOUR ADVENTURES
  2676. ===========================================
  2677.  
  2678. One of the neatest things about GRAAL is that it is very helpful when
  2679. it comes to package your adventures. Using the file DISKINFO.GRAAL and
  2680. the two utility programs GPRO and GDC, it organises everything so that
  2681. all files end up on the correct disk, and makes sure the game knows
  2682. which disk to ask for in any given situation. GPRO can even encrypt
  2683. and compress all script files so that nobody will be able to make
  2684. anything out about the game by looking at the files.
  2685.  
  2686. NOTE: GPRO with encryption is only available to registered users.
  2687.  
  2688. B.1 THE DISKINFO.GRAAL FILE
  2689. ---------------------------
  2690.  
  2691. The DISKINFO.GRAAL file controls the entire behaviour of the game when
  2692. played from diskettes.
  2693.  
  2694. All files that are used anywhere in the game must be specified here
  2695. along with information about which diskette(s) they go onto when
  2696. making or playing from delivery diskettes.
  2697.  
  2698. This is the beginning of a typical DISKINFO.GRAAL file:
  2699.  
  2700. /* First, one comment line to specify contents - must be here!
  2701. Olaf 1 - Disk
  2702. 87
  2703. A Disk.info
  2704. A FONTS
  2705. A Olaf 1
  2706. A Olaf 1.info
  2707. A Diskinfo.graal
  2708. A Graal.comm
  2709. A Graal.dlg
  2710. A Olaf_Original.IFF
  2711. A 1.room
  2712. A 1BG.IFF
  2713. A 1FG.IFF
  2714.  
  2715. Let's examine the lines:
  2716.  
  2717. "Olaf 1 - Disk" is the label that GDC will put on each delivery
  2718. diskette. In addition, it appends a letter to each disk, so the first
  2719. disk becomes known as "Olaf 1 - Disk A" and so forth. When playing
  2720. from diskettes, GRAAL WILL NOT ACCEPT ANY DISKETTES THAT ARE NOT
  2721. CORRECTLY LABELLED. Do not try to put together diskettes manually -
  2722. always use GDC to get it right.
  2723.  
  2724. "87" is the number of file entries currently contained in this
  2725. DISKINFO file.
  2726.  
  2727. After the three initial lines come all the file entries. Each file
  2728. name is on a separate line, preceded by the letter of the diskette the
  2729. file should be placed on.
  2730.  
  2731. It is quite common for one file to exist on more than one diskette, 
  2732. and this is achieved by repeating the entry for each diskette. For
  2733. example, you may want your personal diskette icon (always called
  2734. Disk.info) on each diskette. Just make sure the icon of your choice is
  2735. placed in your development directory, then make an entry for
  2736. "A Disk.info", one for "B Disk.info" - and so on for each diskette.
  2737.  
  2738. There are some files that always should be on diskette A. These are:
  2739.  
  2740. A FONTS  - this is a special entry which will copy the entire FONTS:
  2741.            drawer to the diskette.
  2742.  
  2743. A Olaf 1 - this is the GRAAL_RUN program. Of course, it should have been
  2744.            renamed to whatever YOUR adventure is called.
  2745.  
  2746. A Olaf 1.info - the icon file for the adventure.
  2747.  
  2748. A Diskinfo.graal - Yes, the diskinfo file itself must also be copied!
  2749.  
  2750. All other "system" files are normally also placed on diskette A: Any
  2751. picture files for the overall game graphics, intro scenes, etc.
  2752.  
  2753.  
  2754. B.2 THE DEVELOPMENT PROCESS
  2755. ---------------------------
  2756.  
  2757. This is the way to develop a GRAAL game in a neat way:
  2758.  
  2759.  
  2760. 1. Develop!
  2761.  
  2762. First, create a development directory on a hard disk, where all files
  2763. concerning the development of the game is placed. Apart from the
  2764. script, picture and music files, this includes:
  2765.  
  2766. * The GRAAL_DEV file, renamed to whatever you want your finished
  2767.   game to be called
  2768.  
  2769. * The GPRO and GDC utility programs.
  2770.  
  2771. * (For convenience:) The GRAAL_Editor editor (see appendix C).
  2772.  
  2773. * The DISKINFO.GRAAL file described below.
  2774.  
  2775. * The FONTS: drawer with all the fonts you are planning to use, fixed
  2776.   by the Amiga FIXFONTS utility to be a "valid" fonts drawer.
  2777.  
  2778. Make sure to update DISKINFO.GRAAL as new files to be included in the
  2779. final game are being added.
  2780.  
  2781.  
  2782. 2. Test!
  2783.  
  2784. Create a test directory on a hard disk.
  2785.  
  2786. * Open a shell.
  2787.  
  2788. * Switch to the development directory.
  2789.  
  2790. * Type "GPRO" to start the development-to-test copier.
  2791.  
  2792. * Enter the name of the newly created directory. (GPRO will remember
  2793.   this name next time it is used.)
  2794.  
  2795. * Choose whether to encrypt files or not (probably not until some
  2796.   final version), then press the "copy" button.
  2797.  
  2798. * Run the game in the test directory to see if there are any missing
  2799.   files, etc. If there are, you must update DISKINFO.GRAAL in the
  2800.   development directory and re-run this step.
  2801.  
  2802.  
  2803. 3. Create (and test) diskettes!
  2804.  
  2805. Once everything is finished (or whenever you need to distribute test
  2806. versions), proceed as follows:
  2807.  
  2808. * Ensure you have enough diskettes handy.
  2809.  
  2810. * Open a shell.
  2811.  
  2812. * Switch to the test directory.
  2813.  
  2814. * Type "GDC" to run the diskette copier program.
  2815.  
  2816. * The program now checks approximately how much space the files
  2817.   designated for each diskette will take. If there are too many files
  2818.   assigned to some diskette, the size indication bar for that diskette
  2819.   will become red. You must then re-assign the files in the
  2820.   DISKINFO.GRAAL file - be sure that the changes are made both to the
  2821.   file in the test and the one in the development directory, since
  2822.   GPRO overwrites everything in the test directory every time it is
  2823.   run.
  2824.  
  2825. * Select whether to do a normal or quick format fo the diskettes.
  2826.  
  2827. * Press the "Copy" button to copy to the diskettes. GDC will ask you
  2828.   to switch diskettes at the appropriate times.
  2829.  
  2830. Very important: Test the game from the diskettes! This is the only way
  2831. to see if files are distributed (and in some cases, duplicated) in
  2832. such a way that disk swapping becomes rare and un-annoying!
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839. APPENDIX C: THE EDITOR
  2840. ======================
  2841.  
  2842. GRAAL now sports its very own script editor, called GRAAL_Editor. It is
  2843. documented in the file Editor.text
  2844.